Skip to content

Commit

Permalink
docs(README): recommend using eslint.config.mjs over `eslint.config…
Browse files Browse the repository at this point in the history
….js`
  • Loading branch information
spike-rabbit authored and kfenner committed Feb 3, 2025
1 parent 27ae52a commit fad8e2c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export default typescriptEslint.config({
#### Angular
Include the ESLint preset in your root `eslint.config.js` (not `.mjs`) and make
sure `"type": "module"` is set in your root `package.json`:
Include the ESLint preset in your root `eslint.config.mjs`:
```js
import path from 'path';
Expand Down Expand Up @@ -127,13 +126,11 @@ export default typescriptEslint.config(...tsConfig, ...templateConfig);
```
For libraries and other things in the `projects` directory,
make sure `"type": "module"` is set in the relevant `package.json`
and create an additional
`eslint.config.js` for each project that looks like this:
create an additional `eslint.config.mjs` for each project that looks like this:
```js
import typescriptEslint from 'typescript-eslint';
import { tsConfig, templateConfig } from '../../eslint.config.js';
import { tsConfig, templateConfig } from '../../eslint.config.mjs';

export default typescriptEslint.config(
{
Expand Down Expand Up @@ -167,7 +164,7 @@ export default typescriptEslint.config(
);
```
The `@angular-eslint/builder` will also not automatically pick up the library
The `@angular-eslint/builder` will not automatically pick up the library
config location, manually provide it in `angular.json`:
```diff
Expand All @@ -181,7 +178,7 @@ config location, manually provide it in `angular.json`:
"src/**/*.ts",
"src/**/*.html"
],
+ "eslintConfig": "path/to/project/eslint.config.js"
+ "eslintConfig": "path/to/project/eslint.config.mjs"
}
},
```
Expand Down

0 comments on commit fad8e2c

Please sign in to comment.