Skip to content

chore: add ESLint with angular-eslint and enable it in CI - #2

Merged
NoNamer777 merged 9 commits into
mainfrom
chore/add-eslint
Jul 31, 2026
Merged

chore: add ESLint with angular-eslint and enable it in CI#2
NoNamer777 merged 9 commits into
mainfrom
chore/add-eslint

Conversation

@NoNamer777

Copy link
Copy Markdown
Member

Summary

  • Add eslint.config.mjs using typescript-eslint + angular-eslint, made prettier-compatible via eslint-config-prettier
  • Add the lint target (@angular-eslint/builder) to angular.json and a lint-ts script (ng lint) to package.json
  • Run ESLint via lint-staged for *.ts/*.mjs files, and treat *.mjs as a formatted/text file (.prettierignore, .gitattributes)
  • Un-comment and enable the previously TODO'd "Run ESLint" step in the CI action

Test plan

  • pnpm lint-ts passes locally ("All files pass linting")
  • git commit ran successfully through the updated lint-staged config (prettier + eslint --fix)

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.
@NoNamer777
NoNamer777 merged commit d095e01 into main Jul 31, 2026
1 check passed
@NoNamer777
NoNamer777 deleted the chore/add-eslint branch July 31, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant