Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(README): recommend using eslint.config.mjs over eslint.config.js #19

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -128,13 +127,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 @@ -168,7 +165,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 @@ -182,7 +179,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