-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.js
131 lines (119 loc) · 4.06 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {ecmaVersion: 2018, sourceType: 'module', extraFileExtensions: ['.md']},
plugins: [
'@typescript-eslint/eslint-plugin',
'prettier',
'codegen',
'unicorn',
'jest',
'import',
],
env: { 'jest/globals': true, node: true },
extends: [
// 'eslint:recommended',
// 'plugin:@typescript-eslint/eslint-recommended',
// 'plugin:@typescript-eslint/recommended',
// 'plugin:unicorn/recommended',
'plugin:import/typescript',
'plugin:jest/recommended',
// 'xo',
// 'xo-typescript',
],
ignorePatterns: ['dist', 'node_modules', 'coverage', '.eslintrc.js', 'docs'],
rules: {
'prettier/prettier': ['warn', require('./.prettierrc')],
'codegen/codegen': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/unified-signatures': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
ignoreRestSiblings: true,
args: 'after-used',
}],
'@typescript-eslint/ban-ts-comment': ['error', {'ts-expect-error': false}],
'@typescript-eslint/no-invalid-void-type': 'off',
// xo defaults that overlap with prettier
'comma-dangle': 'off',
'object-curly-spacing': 'off',
'operator-linebreak': 'off',
'no-mixed-spaces-and-tabs': 'off',
'@typescript-eslint/indent': 'off',
'indent': 'off',
'semi': 'off',
'quotes': 'off',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/quotes': 'off',
'eol-last': 'off',
'no-trailing-spaces': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'camelcase': 'off',
'capitalized-comments': 'off',
'jest/expect-expect': [
'error',
{assertFunctionNames: ['expect', 'expectTypeOf', 'expectLeft', 'expectRight']}
],
'no-else-return': ['warn', {allowElseIf: true}],
'@typescript-eslint/naming-convention': ['warn', {
selector: 'variableLike', format: ['camelCase', 'PascalCase'], leadingUnderscore: 'allow',
}],
// maybe turn on later?
'padding-line-between-statements': 'off',
'lines-between-class-members': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'unicorn/no-null': 'off',
'unicorn/filename-case': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/prefer-regexp-exec': 'off',
'jest/no-disabled-tests': 'off',
// covered by `@typescript-eslint/no-unsued-vars`
'no-unused-vars': 'off',
'no-warning-comments': 'off',
'no-dupe-class-members': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-fn-reference-in-iterator': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-reduce': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/new-for-builtins': 'off',
'unicorn/throw-new-error': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/prefer-trim-start-end': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-base-to-string': 'off',
},
overrides: [
{
files: ['src/generated/*'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
}
},
{
files: ['**/*.js'],
parserOptions: {sourceType: 'script'},
rules: {
'@typescript-eslint/no-var-requires': 'off',
}
},
{
files: ['**/*.md'],
rules: {
'unicorn/filename-case': 'off',
'prettier/prettier': 'off',
}
},
]
}