Skip to content

Commit 78913de

Browse files
committed
chore(eslint): simplify config
1 parent 0f7d694 commit 78913de

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

eslint.config.js

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,16 @@ import tseslint from 'typescript-eslint'
1010

1111
export default tseslint.config(
1212
{
13-
name: 'exuanbo/languages-node',
14-
files: ['**/*.?(c|m)js', '*.?(c|m)ts'],
13+
name: 'exuanbo/languages',
1514
languageOptions: {
16-
// https://vitejs.dev/blog/announcing-vite5.html#node-js-support
17-
// https://node.green/#ES2022
1815
ecmaVersion: 2022,
1916
globals: {
17+
...globals.browser,
2018
...globals.es2022,
2119
...globals.node,
2220
},
2321
},
2422
},
25-
{
26-
name: 'exuanbo/languages-browser',
27-
files: ['src/**/*.?(c|m){j,t}s?(x)'],
28-
languageOptions: {
29-
// https://vitejs.dev/guide/build.html#browser-compatibility
30-
ecmaVersion: 2021,
31-
globals: {
32-
...globals.browser,
33-
...globals.es2021,
34-
},
35-
},
36-
},
3723
{
3824
name: 'exuanbo/ignores',
3925
ignores: ['.yarn', 'coverage', 'dist'],
@@ -61,19 +47,21 @@ export default tseslint.config(
6147
'@typescript-eslint/consistent-type-imports': ['error', {
6248
fixStyle: 'inline-type-imports',
6349
}],
50+
'@typescript-eslint/no-import-type-side-effects': 'error',
51+
'@typescript-eslint/no-namespace': ['error', {
52+
allowDeclarations: true,
53+
}],
54+
'@typescript-eslint/no-unused-expressions': ['error', {
55+
allowShortCircuit: true,
56+
}],
6457
'@typescript-eslint/no-empty-object-type': 'off',
6558
'@typescript-eslint/no-explicit-any': 'off',
66-
'@typescript-eslint/no-import-type-side-effects': 'error',
67-
'@typescript-eslint/no-namespace': 'off',
6859
'@typescript-eslint/no-unsafe-argument': 'off',
6960
'@typescript-eslint/no-unsafe-assignment': 'off',
7061
'@typescript-eslint/no-unsafe-call': 'off',
7162
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
7263
'@typescript-eslint/no-unsafe-function-type': 'off',
7364
'@typescript-eslint/no-unsafe-return': 'off',
74-
'@typescript-eslint/no-unused-expressions': ['error', {
75-
allowShortCircuit: true,
76-
}],
7765
},
7866
},
7967
{

0 commit comments

Comments
 (0)