-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
116 lines (111 loc) · 4.44 KB
/
eslint.config.mjs
File metadata and controls
116 lines (111 loc) · 4.44 KB
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
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},
rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],
// builtin
'default-param-last': ['warn'],
'eqeqeq': ['warn', 'smart'],
'no-constructor-return': ['error'],
'no-empty': ['warn'],
'no-unused-vars': ['warn', { 'args': 'none' }],
'no-lonely-if': ['warn'],
'no-nested-ternary': ['error'],
'no-shadow': ['error'],
'no-undef': ['off'],
'no-undef-init': ['error'],
'no-unneeded-ternary': ['warn'],
'no-useless-return': ['warn'],
'no-var': ['error'],
'default-case-last': ['warn'],
'no-else-return': ['warn'],
'no-duplicate-imports': ['warn'],
'camelcase': [
'error',
{
'properties': 'always',
'ignoreDestructuring': true,
},
],
'object-shorthand': ['warn', 'always'],
'operator-assignment': ['warn', 'always'],
'prefer-arrow-callback': ['error'],
'prefer-exponentiation-operator': ['warn'],
'prefer-template': ['warn'],
'yoda': ['warn'],
'prefer-const': ['off'],
// @stylistic
'@stylistic/member-delimiter-style': [
'warn',
{
"multiline": {
"delimiter": "none",
"requireLast": false,
},
"singleline": {
"delimiter": "semi",
"requireLast": false,
},
"multilineDetection": "brackets",
},
],
'@stylistic/array-bracket-newline': ['warn', 'consistent'],
'@stylistic/arrow-parens': ['warn'],
'@stylistic/arrow-spacing': ['warn'],
'@stylistic/block-spacing': ['warn', 'always'],
'@stylistic/brace-style': ['warn', '1tbs', { 'allowSingleLine': true }],
'@stylistic/comma-dangle': ["warn", "always-multiline"],
'@stylistic/comma-spacing': ['warn'],
'@stylistic/comma-style': ['warn'],
'@stylistic/computed-property-spacing': ['warn'],
'@stylistic/dot-location': ['warn', 'property'],
'@stylistic/eol-last': ['warn'],
'@stylistic/func-call-spacing': ['warn'],
'@stylistic/function-call-argument-newline': ['warn', 'consistent'],
'@stylistic/function-paren-newline': ['warn', 'consistent'],
'@stylistic/generator-star-spacing': ['warn'],
'@stylistic/implicit-arrow-linebreak': ['warn'],
'@stylistic/indent': ['warn', 2],
'@stylistic/key-spacing': ['warn'],
'@stylistic/keyword-spacing': ['warn'],
'@stylistic/linebreak-style': ['warn', 'unix'],
'@stylistic/newline-per-chained-call': ['warn', { 'ignoreChainWithDepth': 3 }],
'@stylistic/no-confusing-arrow': ['warn'],
'@stylistic/no-extra-semi': ['warn'],
'@stylistic/no-multiple-empty-lines': ['warn', { 'max': 2 }],
'@stylistic/no-trailing-spaces': ['warn'],
'@stylistic/no-whitespace-before-property': ['warn'],
'@stylistic/nonblock-statement-body-position': ['warn'],
'@stylistic/object-curly-newline': ['warn'],
'@stylistic/object-curly-spacing': ['warn', 'always'],
'@stylistic/object-property-newline': ['warn', { 'allowAllPropertiesOnSameLine': true }],
'@stylistic/operator-linebreak': ['warn', 'after'],
'@stylistic/padded-blocks': ['warn', 'never'],
'@stylistic/rest-spread-spacing': ['warn'],
'@stylistic/semi': ['error', 'never'],
'@stylistic/semi-spacing': ['warn'],
'@stylistic/space-before-blocks': ['warn'],
'@stylistic/space-before-function-paren': ['warn', 'never'],
'@stylistic/space-in-parens': ['warn', 'never'],
'@stylistic/space-infix-ops': ['error'],
'@stylistic/spaced-comment': ['warn', 'always'],
'@stylistic/switch-colon-spacing': ['warn'],
'@stylistic/template-curly-spacing': ['warn'],
'@stylistic/type-annotation-spacing': ['warn'],
'@stylistic/wrap-iife': ['error'],
'@stylistic/yield-star-spacing': ['warn'],
},
}];