-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
73 lines (68 loc) · 1.81 KB
/
.eslintrc.cjs
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
// @ts-check
/** @type { import('eslint').Linter.Config } */
const config = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'xo'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
rules: {
'no-undef': 'off',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: [
'./tsconfig.json',
'./tsconfig.eslint.json',
],
},
rules: {
// deactivate defaults
'capitalized-comments': 'off',
'comma-spacing': 'off',
'no-implicit-coercion': 'off',
camelcase: 'off',
'no-redeclare': 'off',
'no-undef': 'off',
'comma-dangle': 'off',
// modify defaults
'no-multi-spaces': 'warn',
'no-trailing-spaces': 'warn',
'no-multiple-empty-lines': 'warn',
'no-mixed-spaces-and-tabs': 'warn',
'object-shorthand': 'warn',
'space-in-parens': 'warn',
'key-spacing': 'warn',
'padded-blocks': 'warn',
// TypeScript overrides
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-redeclare': 'error',
'no-return-assign': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
// modify rules
'no-var': 'error',
'no-console': ['error'],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
semi: ['error', 'never'],
indent: ['off', 'tab'],
'object-curly-spacing': ['warn', 'always'],
curly: ['warn', 'multi-line'],
'no-unused-expressions': ['warn', { allowShortCircuit: true }],
'@typescript-eslint/no-empty-function': ['warn'],
},
}
module.exports = config