Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- 23
eslint:
- 8
- 9
- 10
- local

steps:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Install eslint and this config:
npm i -D eslint eslint-config-preact
```

Now in your `eslint.config.js`:
Now in your `eslint.config.js` (ESLint 8, 9, or 10):

```ts
import preact from 'eslint-config-preact';
Expand All @@ -34,3 +34,5 @@ module.exports = [
...preact
];
```

> **Note:** ESLint 10 dropped support for legacy `.eslintrc.*` config files. All users (including ESLint 8+ users) should use the flat config format (`eslint.config.js`) shown above.
18 changes: 2 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import parser from '@babel/eslint-parser';
import eslintJS from '@eslint/js';
import compat from 'eslint-plugin-compat';
import react from 'eslint-plugin-react';
Expand All @@ -9,24 +8,11 @@ const configs = [
eslintJS.configs.recommended,
{
languageOptions: {
// TODO: this is really only required for class property initializer methods, which are seeing declining usage.
// At some point, we should un-ship the custom parser and let ESLint use esprima.
parser,
// Currently ignored due to the custom parser.
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
modules: true,
impliedStrict: true,
jsx: true
},
requireConfigFile: false,
babelOptions: {
plugins: [
'@babel/plugin-syntax-class-properties',
'@babel/plugin-syntax-jsx'
]
}
},
globals: {
Expand Down
Loading