Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit c109901

Browse files
authored
feat: bump to eslint v9 (#803)
1 parent b53252c commit c109901

5 files changed

Lines changed: 335 additions & 463 deletions

File tree

.eslintrc.cjs

Lines changed: 0 additions & 45 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ tests/typings/dist
6262

6363
build
6464
/*.js
65-
!.eslintrc.cjs
65+
!eslint.config.js
6666
.idea/
6767
.DS_Store
6868
*.tsbuildinfo

eslint.config.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// @ts-check
2+
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
3+
import eslint from '@eslint/js'
4+
import tseslint from 'typescript-eslint'
5+
import globals from 'globals'
6+
import importPlugin from 'eslint-plugin-import'
7+
8+
export default tseslint.config(
9+
eslint.configs.recommended,
10+
...tseslint.configs.recommended,
11+
importPlugin.flatConfigs.errors,
12+
importPlugin.flatConfigs.warnings,
13+
{
14+
plugins: {
15+
unicorn: eslintPluginUnicorn,
16+
},
17+
languageOptions: {
18+
globals: {
19+
...globals.node,
20+
...globals.es5,
21+
...globals.jest,
22+
},
23+
ecmaVersion: 2019,
24+
sourceType: 'module',
25+
},
26+
rules: {
27+
semi: ['error', 'never'],
28+
quotes: ['error', 'single'],
29+
indent: [2, 4],
30+
31+
'no-constant-condition': 0,
32+
// see https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un
33+
'no-unused-vars': 'off',
34+
'@typescript-eslint/no-unused-vars': 'error',
35+
36+
'import/no-unresolved': 0,
37+
'import/named': 2,
38+
'import/namespace': 2,
39+
'import/default': 2,
40+
'import/export': 2,
41+
42+
'unicorn/prefer-node-protocol': 'error',
43+
},
44+
ignores: ['./build/*'],
45+
},
46+
{
47+
files: ['*.ts'],
48+
rules: {
49+
'no-undef': 'off',
50+
},
51+
},
52+
)

0 commit comments

Comments
 (0)