-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
57 lines (56 loc) · 1.69 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import { config, configs } from 'typescript-eslint';
export default config({
extends: [
eslint.configs.recommended,
...configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
eslintPluginPrettierRecommended
],
ignores: ['dist/**/*'],
languageOptions: {
globals: {
...globals.node
},
parserOptions: {
tsconfigRootDir: import.meta.dirname
}
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
// You will also need to install and configure the TypeScript resolver
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
typescript: {
project: './tsconfig.json'
},
node: true
}
},
rules: {
'import/no-unresolved': ['error', { caseSensitive: true }],
'import/named': 'error',
'import/first': 'warn',
'import/no-duplicates': 'error',
'import/extensions': ['warn', 'always', { js: 'never', ts: 'never', json: 'always' }],
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
'newlines-between': 'never',
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
named: true,
alphabetize: {
order: 'asc' /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
caseInsensitive: true /* ignore case. Options: [true, false] */
}
}
]
}
});