-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy patheslint.config.mjs
52 lines (51 loc) · 1.44 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
import typescriptEslintRecommended from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import perfectionist from 'eslint-plugin-perfectionist';
import unusedImports from 'eslint-plugin-unused-imports';
export default [
{
files: ['src/**/*.ts'],
ignores: ['src/localize/**'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': typescriptEslintRecommended,
perfectionist,
'unused-imports': unusedImports,
},
rules: {
// TypeScript recommended rules
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': 'warn',
// Perfectionist sort-imports rule
'perfectionist/sort-imports': [
'error',
{
type: 'alphabetical',
order: 'asc',
ignoreCase: true,
newlinesBetween: 'always',
maxLineLength: undefined,
groups: [
'type',
['builtin', 'external'],
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown',
],
customGroups: { type: {}, value: {} },
environment: 'node',
},
],
},
},
];