-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
75 lines (73 loc) · 2.23 KB
/
.eslintrc.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
63
64
65
66
67
68
69
70
71
72
73
74
75
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:import/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
plugins: [
'prettier',
'@typescript-eslint',
'prefer-arrow-functions',
'eslint-comments',
'unused-imports',
'sort-exports',
],
parserOptions: {
ecmaVersion: 2020,
project: './tsconfig.json',
createDefaultProgram: true,
},
rules: {
'max-classes-per-file': 'off',
'no-restricted-syntax': 'off',
'no-use-before-define': 'off',
'eslint-comments/no-unused-enable': 'warn',
'eslint-comments/no-unused-disable': 'warn',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'import/order': [
'error',
{
groups: [
['builtin', 'external'],
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'unused-imports/no-unused-imports': 'error',
'prefer-arrow-functions/prefer-arrow-functions': [
'warn',
{
classPropertiesAllowed: false,
disallowPrototype: false,
returnStyle: 'unchanged',
singleReturnOnly: false,
},
],
'@typescript-eslint/no-unnecessary-condition': 'warn',
},
settings: {
'import/resolver': {
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
},
overrides: [
{
files: ['src/main.ts'],
rules: { 'sort-exports/sort-exports': ['error', { sortDir: 'asc' }] },
},
],
ignorePatterns: ['**/antlr4/*.js', '**/dist/**/*'],
};