Skip to content

Commit f663af6

Browse files
Add a step to the Angular documentation for updating lintFilePatterns in angular.json.
1 parent ba857c7 commit f663af6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ ESLint support for Angular is provided by [`angular-eslint`](https://github.com/
108108
```js
109109
import { defineConfig } from 'eslint/config';
110110
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';
112112
113113
export default defineConfig([
114114
{
115115
// JavaScript rules fail to parse the HTML files that are added below. Therefore, the JavaScript
116116
// 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]
119119
},
120120
{
121121
files: ['**/*.ts'],
@@ -144,6 +144,15 @@ ESLint support for Angular is provided by [`angular-eslint`](https://github.com/
144144
}
145145
]);
146146
```
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+
```
147156
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.
148157
6. With flat configurations, configurations for subdirectories 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 configurations in 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).
149158

0 commit comments

Comments
 (0)