-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
110 lines (105 loc) · 3.2 KB
/
eslint.config.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
import eslint from '@eslint/js';
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
import pluginPromise from 'eslint-plugin-promise'
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
pluginPromise.configs['flat/recommended'],
{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
},
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
ignores: [
'node_modules/**',
'dist/**',
'bin',
],
linterOptions: {
noInlineConfig: false,
reportUnusedDisableDirectives: 'error',
},
},
{
rules: {
'indent': ['error', 'tab', {
'SwitchCase': 1,
}],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'brace-style': ['error', '1tbs'],
'space-before-blocks': ['error', 'always'],
"no-console": "error",
"block-scoped-var": "warn",
"default-case": "error",
"eqeqeq": ["error", "always", {"null": "ignore"}],
"no-alert": "error",
"no-else-return": "warn",
"no-empty-function": "error",
"no-eval": "warn",
"no-extra-label": "warn",
"array-bracket-spacing": ["warn","never"],
"block-spacing": ["warn", "always"],
"camelcase": ["error", {properties: "never"}],
"comma-spacing": "warn",
"eol-last": ["error", "always"],
"func-style": ["warn", "declaration", {"allowArrowFunctions": true}],
"no-multiple-empty-lines": ["error", {"max": 1}],
"comma-dangle": ["error", "only-multiline"],
"strict": ["error", "never"],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"new-parens": "error",
"no-case-declarations": "warn",
"prefer-const": "error",
"prefer-destructuring": ["warn", {
"VariableDeclarator": {"object": true, "array": false},
"AssignmentExpression": {"object": false, "array": false},
}],
"prefer-rest-params": "error",
"prefer-template": "warn",
"new-cap": ["warn", {"capIsNewExceptions": ["MandatoryFields"]}],
"callback-return": "error",
"max-len": [
"warn",
{
"code": 160,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
allowArray: true,
}],
'@typescript-eslint/prefer-nullish-coalescing': 'off', // requires strictNullChecks
'@typescript-eslint/no-unnecessary-condition': 'off', // requires strictNullChecks
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off', // requires strictNullChecks
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_$" }],
"@typescript-eslint/no-unsafe-assignment": 'off',
"promise/prefer-await-to-then": "error",
"promise/prefer-await-to-callbacks": "error",
},
},
{
plugins: { 'chai-friendly': pluginChaiFriendly },
rules: {
'no-unused-expressions': 'off', // disable original rule
'@typescript-eslint/no-unused-expressions': 'off', // disable original rule
'chai-friendly/no-unused-expressions': 'error',
},
},
);