Skip to content

Commit c7b8902

Browse files
authored
fix: Migrate to eslint 9 (#7961)
* Update to eslint 9 * Automatic changes * Manual changes * fix no-return-await * @typescript-eslint/await-thenable * @typescript-eslint/no-unused-vars * @typescript-eslint/ban-ts-comment * ignore @typescript-eslint/explicit-function-return-type * no-prototype-builtins * process feedback * @typescript-eslint/return-await * `@typescript-eslint/return-await` `always`
1 parent 861f8df commit c7b8902

File tree

234 files changed

+2227
-2233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+2227
-2233
lines changed

.eslintignore

-7
This file was deleted.

.eslintrc.json

-55
This file was deleted.

.github/workflows/update_deps.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
node-version: 20
2222
cache: npm
23-
- run: npx npm-check-updates -u -x eslint
23+
- run: npx npm-check-updates -u
2424
- run: rm -f package-lock.json
2525
- run: npm install
2626
- uses: peter-evans/create-pull-request@v7

.prettierrc

+19-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,23 @@
55
"printWidth": 150,
66
"bracketSpacing": false,
77
"endOfLine": "lf",
8-
"tabWidth": 4
8+
"tabWidth": 4,
9+
"importOrder": [
10+
"",
11+
"<TYPES>^(node:)",
12+
"",
13+
"<TYPES>",
14+
"",
15+
"<TYPES>^[.]",
16+
"",
17+
"<BUILTIN_MODULES>",
18+
"",
19+
"<THIRD_PARTY_MODULES>",
20+
"",
21+
"^zigbee",
22+
"",
23+
"^[.]"
24+
],
25+
"importOrderParserPlugins": ["typescript", "decorators"],
26+
"plugins": ["@ianvs/prettier-plugin-sort-imports"]
927
}

eslint.config.mjs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import eslintConfigPrettier from 'eslint-config-prettier';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{
11+
languageOptions: {
12+
parserOptions: {
13+
project: true,
14+
},
15+
},
16+
rules: {
17+
'@typescript-eslint/await-thenable': 'error',
18+
'@typescript-eslint/ban-ts-comment': 'error',
19+
// Not enabled for now, gives 3.6k errors which require manual fixing.
20+
// '@typescript-eslint/explicit-function-return-type': 'error',
21+
'@typescript-eslint/no-explicit-any': 'error',
22+
'@typescript-eslint/no-unused-vars': ['error', {args: 'none'}],
23+
'array-bracket-spacing': ['error', 'never'],
24+
'@typescript-eslint/return-await': ['error', 'always'],
25+
'object-curly-spacing': ['error', 'never'],
26+
'@typescript-eslint/no-floating-promises': 'error',
27+
},
28+
},
29+
{
30+
ignores: ['test/', 'index.*', 'converters/', 'devices/', 'lib/', 'scripts/', '**/*.mjs'],
31+
},
32+
eslintConfigPrettier,
33+
);

0 commit comments

Comments
 (0)