Add ESLint configuration for consistent code quality #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧼 Add ESLint configuration for consistent code quality
This PR introduces a modern ESLint setup providing a consistent baseline for JavaScript, TypeScript, and Astro files. The configuration is lightweight and integrates smoothly with our existing tooling (Prettier, TypeScript, and lint-staged).
🧠 Why?
This ESLint setup would work alongside Prettier to help us maintain a high-quality and reliable codebase.
While Prettier takes care of code formatting (spacing, line length, punctuation, etc.), ESLint focuses on code correctness, consistency, rigor, and safety. It adds another layer of confidence by:
await
)any
)Together, Prettier and ESLint ensure our code is not only clean to look at—but also clean to run and maintain.
Note
This setup is inspired from one of our projects (Scout) and our pleasant experience with it.
🔧 What's included
@eslint/js
recommendations@typescript-eslint
eslint-config-prettier
eslint-plugin-astro
lint-staged
andsimple-git-hooks
⚙️ How it works
eslint.config.js
using the new flat config formatpre-commit
, the following happens automatically thanks tosimple-git-hooks
andlint-staged
:*
) — as usual.js
,.ts
,.jsx
,.tsx
, or.astro
files and auto-fixes where possible📁 Default ignores
The config ignores the following paths by default:
.astro/
(Astro build artifacts)dist/
(build output)node_modules/
💬 Feedback welcome
Let’s keep our code clean, consistent, and a little easier to love.
Warning
This PR doesn't fix errors found by ESLint on the whole project. Since this PR only allows to run the linter on staged files, I chose to ignore those for the moment. Once merged, one should — probably me — create another PR to fix all the issues on the repo.