You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a step to the Angular documentation for updating lintFilePatterns in angular.json. (#178)
Finish addressing [#126: Language configuration is
confusing](#126).
- Add a step to the Angular documentation for updating
`lintFilePatterns` in `angular.json`.
Copy file name to clipboardExpand all lines: README.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,14 +108,14 @@ ESLint support for Angular is provided by [`angular-eslint`](https://github.com/
108
108
```js
109
109
import { defineConfig } from 'eslint/config';
110
110
import { angularTypescriptConfig, angularTemplateConfig } from '@ni/eslint-config-angular';
111
-
import { javascriptConfig } from '@ni/eslint-config-javascript';
111
+
import { javascriptConfig, importNodeEsmConfig } from '@ni/eslint-config-javascript';
112
112
113
113
export default defineConfig([
114
114
{
115
115
// JavaScript rules fail to parse the HTML files that are added below. Therefore, the JavaScript
116
116
// configuration must now match the correct files to avoid an error.
117
-
files: ['**/*.js'],
118
-
extends: javascriptConfig
117
+
files: ['**/*.js', '**/*.mjs'],
118
+
extends: [javascriptConfig, importNodeEsmConfig]
119
119
},
120
120
{
121
121
files: ['**/*.ts'],
@@ -144,6 +144,15 @@ ESLint support for Angular is provided by [`angular-eslint`](https://github.com/
144
144
}
145
145
]);
146
146
```
147
+
5. Update the `lintFilePatterns`in`angular.json` to include `.ts`, `.html`, and `.js`, and `.mjs` files.
148
+
```json
149
+
"lintFilePatterns": [
150
+
"src/**/*.ts",
151
+
"src/**/*.js",
152
+
"src/**/*.mjs",
153
+
"src/**/*.html"
154
+
]
155
+
```
147
156
5. Evaluate the [project specific rule groups](#evaluate-project-specific-rule-groups) to manually add to your lint configuration. For Angular applications in particular, consider enabling the [`[application-prefix]`](#application-prefix) rule group.
148
157
6. With flat configurations, configurations forsubdirectories must be defined at the root except for projects which are already root configurations. ESLint loads only one flat configuration resolved relative to the working directory (e.g. root). Support for defining configurationsin subdirectories is experimental behind an active feature flag. The angular-eslint builder does not support this feature flag. See ESLint [issue #18385](https://github.com/eslint/eslint/issues/18385).
0 commit comments