chore: add ESLint with angular-eslint and enable it in CI - #2
Merged
Conversation
Wires up eslint.config.mjs (typescript-eslint + angular-eslint, prettier-compatible), adds the ng lint builder, runs eslint via lint-staged, and re-enables the previously TODO'd CI lint step.
Update the editor-setup and usage sections now that ESLint is wired up, replacing the stale "not configured yet" note.
Add the ESLint extension to the recommended list and wire up a lint-ts task alongside the other npm-script tasks, matching how Prettier and markdownlint are already set up.
WebStorm requires enabling ESLint under Code Quality Tools, it doesn't run automatically like Prettier does. Document the actual steps, mirroring the Prettier setup instructions above.
The ESLint extension surfaces lint errors inline out of the box, but fixing them on save needs an explicit codeActionsOnSave setting, same as Prettier's formatOnSave above it.
Match the existing per-script run configs (lint-md, format, etc.) so lint-ts can also be run from WebStorm without a terminal.
Exclude .angular/, coverage/, dist/, and reports/ from linting so ESLint doesn't walk generated files.
Splitting .mjs and .ts into their own base config left .mjs files matched by no `files` block with rules enabled, so lint-staged's `eslint --fix` on eslint.config.mjs itself was a no-op. Give both extensions ESLint's core recommended rules, and keep the TypeScript-only type-checked/Angular rules and `projectService` parser option scoped to .ts.
TypeScript's own noUnusedLocals/noUnusedParameters (tsconfig.json) already catch this, so the ESLint rule is redundant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
eslint.config.mjsusingtypescript-eslint+angular-eslint, made prettier-compatible viaeslint-config-prettierlinttarget (@angular-eslint/builder) toangular.jsonand alint-tsscript (ng lint) topackage.jsonlint-stagedfor*.ts/*.mjsfiles, and treat*.mjsas a formatted/text file (.prettierignore,.gitattributes)Test plan
pnpm lint-tspasses locally ("All files pass linting")git commitran successfully through the updated lint-staged config (prettier + eslint --fix)