-
Notifications
You must be signed in to change notification settings - Fork 14
/
eslint.config.js
157 lines (154 loc) · 5.53 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import stylisticJs from '@stylistic/eslint-plugin-js';
import taggedIs from './rules/tagged-is.js';
export default [
{
languageOptions: {
sourceType: 'script',
globals: {
TshetUinh: 'readonly',
音韻地位: 'writable',
字頭: 'writable',
選項: 'readonly',
require: 'readonly',
},
parserOptions: {
ecmaFeatures: {
globalReturn: true,
impliedStrict: true,
},
},
},
plugins: {
'@stylistic/js': stylisticJs,
'tagged-is': {
rules: {
'tagged-is': taggedIs,
},
},
},
rules: {
'no-constant-binary-expression': 'error',
'no-debugger': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'no-unreachable-loop': 'error',
'no-unused-private-class-members': 'error',
'no-unused-vars': ['error', { varsIgnorePattern: '^(is|when)$' }],
'no-useless-assignment': 'error',
'no-useless-backreference': 'error',
'default-case-last': 'error',
'eqeqeq': 'error',
'grouped-accessor-pairs': 'error',
'logical-assignment-operators': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-empty-function': 'error',
'no-empty-static-block': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-global-assign': 'error',
'no-label-var': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-object-constructor': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-shadow-restricted-names': 'error',
'no-throw-literal': 'error',
'no-undefined': 'error',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': 'error',
'object-shorthand': 'error',
'operator-assignment': 'error',
'prefer-arrow-callback': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'strict': ['error', 'never'],
'symbol-description': 'error',
'@stylistic/js/array-bracket-spacing': 'error',
'@stylistic/js/arrow-parens': ['error', 'as-needed'],
'@stylistic/js/arrow-spacing': 'error',
'@stylistic/js/block-spacing': 'error',
'@stylistic/js/comma-spacing': 'error',
'@stylistic/js/comma-style': 'error',
'@stylistic/js/computed-property-spacing': 'error',
'@stylistic/js/dot-location': ['error', 'property'],
'@stylistic/js/eol-last': 'error',
'@stylistic/js/function-call-spacing': 'error',
'@stylistic/js/generator-star-spacing': ['error', 'after'],
'@stylistic/js/indent': ['error', 2, { SwitchCase: 1, ArrayExpression: 'off', ObjectExpression: 'off' }],
'@stylistic/js/key-spacing': 'error',
'@stylistic/js/keyword-spacing': 'error',
'@stylistic/js/new-parens': 'error',
'@stylistic/js/no-extra-semi': 'error',
'@stylistic/js/no-floating-decimal': 'error',
'@stylistic/js/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
'@stylistic/js/no-tabs': 'error',
'@stylistic/js/no-trailing-spaces': 'error',
'@stylistic/js/no-whitespace-before-property': 'error',
'@stylistic/js/object-curly-spacing': ['error', 'always'],
'@stylistic/js/operator-linebreak': ['error', 'after'],
'@stylistic/js/padded-blocks': ['error', 'never'],
'@stylistic/js/quote-props': ['error', 'consistent'],
'@stylistic/js/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/js/rest-spread-spacing': 'error',
'@stylistic/js/semi': 'error',
'@stylistic/js/semi-spacing': 'error',
'@stylistic/js/semi-style': 'error',
'@stylistic/js/space-before-blocks': 'error',
'@stylistic/js/space-before-function-paren': ['error', { anonymous: 'always', named: 'never', asyncArrow: 'always' }],
'@stylistic/js/space-in-parens': 'error',
'@stylistic/js/space-infix-ops': 'error',
'@stylistic/js/space-unary-ops': 'error',
'@stylistic/js/spaced-comment': 'error',
'@stylistic/js/switch-colon-spacing': 'error',
'@stylistic/js/template-curly-spacing': 'error',
'@stylistic/js/template-tag-spacing': 'error',
'@stylistic/js/yield-star-spacing': 'error',
'tagged-is/tagged-is': 'error',
},
},
{
files: ['eslint.config.js', '*/**/*.js'],
languageOptions: {
sourceType: 'module',
globals: {
TshetUinh: 'off',
音韻地位: 'off',
字頭: 'off',
選項: 'off',
require: 'off',
console: 'readonly',
process: 'readonly',
},
parserOptions: {
ecmaFeatures: {},
},
},
},
];