-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
62 lines (59 loc) · 1.5 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import pluginJs from '@eslint/js';
import configPrettier from 'eslint-config-prettier';
import pluginImportX from 'eslint-plugin-import-x';
import globals from 'globals';
import { config, configs as configsTs, parser } from 'typescript-eslint';
export default config(
{
files: ['**/*.{js,mjs,cjs,jsx,ts,cts,mts,tsx,vue}'],
languageOptions: { parser },
},
pluginJs.configs.recommended,
...configsTs.recommended,
configPrettier,
pluginImportX.flatConfigs.recommended,
pluginImportX.flatConfigs.typescript,
{
settings: {
'import-x/resolver': { typescript: true, node: true },
},
rules: {
'import-x/order': ['error', { alphabetize: { order: 'asc' } }],
'import-x/no-deprecated': ['warn'],
},
},
// overrides
{
rules: {
'@typescript-eslint/no-unused-expressions': ['error', { allowTernary: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-console': 'error',
'prefer-destructuring': 'warn',
eqeqeq: 'error',
},
},
// Node scripts
{
files: [
'eslint.config.js',
'rollup*.config.js',
'scripts/**',
'./*.{js,ts}',
'packages/*/*.js',
],
languageOptions: { globals: globals.node },
rules: {
'no-restricted-globals': 'off',
'no-console': 'off',
},
},
{
ignores: ['**/dist/', '**/temp/', '**/coverage/', '.idea/'],
},
);