-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (103 loc) · 3.43 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'node', 'prettier', 'import',],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
'plugin:import/typescript',
],
ignorePatterns: ['lib/', 'node_modules/', 'coverage/', 'jest.config.js', '.eslintrc.js'],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
// node: {
// paths: ['src'],
// extensions: ['.js', '.jsx', '.ts', '.tsx']
// }
}
},
rules: {
'prettier/prettier': 'warn',
'node/no-missing-import': 'off',
'node/no-empty-function': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'node/no-missing-require': 'off',
'node/shebang': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'node/no-unpublished-import': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'sort-imports': [
'warn',
{
ignoreCase: false,
ignoreDeclarationSort: true, // don't want to sort import lines, use eslint-plugin-import instead
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
],
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', ['sibling', 'parent'], 'index', 'unknown'],
'newlines-between': 'always',
alphabetize: {
/* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */
order: 'asc',
/* ignore case. Options: [true, false] */
caseInsensitive: true,
},
},
],
'import/no-unresolved': 'error',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'prefer-const': 'warn',
'no-empty-function': 'warn',
'no-console': 'warn',
indent: ['off', 2, { SwitchCase: 1, ignoredNodes: ['PropertyDefinition'] }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'comma-dangle': [
'error',
{
arrays: 'only-multiline',
objects: 'only-multiline',
imports: 'only-multiline',
exports: 'only-multiline',
functions: 'only-multiline',
},
],
'no-cond-assign': ['error', 'always'],
'no-trailing-spaces': 'error',
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
'object-curly-newline': [
'error',
{
ImportDeclaration: { multiline: true, minProperties: 6 },
ExportDeclaration: { multiline: true, minProperties: 6 },
},
],
'no-unused-vars': ['warn', { vars: 'all', args: 'none', ignoreRestSiblings: false }],
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'no-duplicate-imports': ['error', { includeExports: true }],
'@typescript-eslint/no-unsafe-member-access': 'warn'
},
};