]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/RELEASE_NOTES_NEXT/Architecture/eslint.adoc
LP 2061136 follow-up: ng lint --fix
[working/Evergreen.git] / docs / RELEASE_NOTES_NEXT / Architecture / eslint.adoc
1 == (Developer-focused) Use ESLint for eg2 ==
2
3 The `eg2` Angular application now uses ESLint rather than TSLint for
4 source code linting. This is motivated by the deprecation of TSLint
5 by the Angular CLI, but ESLint also offer some improvements.
6
7 In particular, ESLint checks the HTML templates in addition to the
8 TypeScript code. For example, it will catch uses of `==` in the
9 templates when `===` is preferred.
10
11 The primary ESLint rules applied to the project are configured in
12 `Open-ILS/src/eg2/.eslintrc.json`. To override them for specific
13 directories, `.eslintrc` files can be used. An example of this
14 is `Open-ILS/src/eg2/src/app/share/.eslintrc`, which turns off
15 the `angular-eslint/no-output-on-prefix` check that discourages
16 using `onFoo` as the name of `@Output()` properties. This rule
17 is now enforced in most of `eg2`, but it was decided not to immediately
18 mandate for shared components.
19
20 The command to run the lint checks remains the same: from
21 `Open-ILS/src/eg2/`, run `ng lint`.