-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
154 lines (151 loc) · 5.64 KB
/
eslint.config.js
File metadata and controls
154 lines (151 loc) · 5.64 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
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
// @ts-check
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import reactHooks from 'eslint-plugin-react-hooks';
export default defineConfig(
{
ignores: [
'dist',
'eslint.config.js',
'vite.config.ts',
'vitest.config.ts'
]
},
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
reactHooks.configs.flat.recommended,
{
plugins: {
'@stylistic': stylistic
},
languageOptions: {
ecmaVersion: 2015,
sourceType: 'module',
parserOptions: {
projectService: true
}
},
rules: {
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }],
'@typescript-eslint/no-empty-function': 'off',
'accessor-pairs': 'error',
'array-callback-return': 'error',
'block-scoped-var': 'error',
'consistent-return': 'error',
'curly': 'error',
'default-case-last': 'error',
'eqeqeq': ['error', 'smart'],
'func-name-matching': 'error',
'func-style': ['error', 'expression', { overrides: { namedExports: 'ignore' } }],
'grouped-accessor-pairs': 'error',
'max-depth': 'error',
'max-nested-callbacks': 'error',
'new-cap': 'error',
'no-caller': 'error',
'no-constructor-return': 'error',
'no-div-regex': 'error',
'no-else-return': 'error',
'no-empty-static-block': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-multi-assign': ['error', { ignoreNonDeclaration: true }],
'no-multi-str': 'error',
'no-negated-condition': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-object-constructor': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
'no-template-curly-in-string': 'error',
'no-undef-init': 'error',
'no-unmodified-loop-condition': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable-loop': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-warning-comments': 'error',
'operator-assignment': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'radix': 'error',
'require-atomic-updates': 'error',
'symbol-description': 'error',
'unicode-bom': 'error',
'yoda': 'error',
'@stylistic/array-bracket-spacing': ['warn', 'never'],
'@stylistic/arrow-spacing': 'warn',
'@stylistic/block-spacing': 'warn',
'@stylistic/comma-dangle': 'warn',
'@stylistic/comma-spacing': 'warn',
'@stylistic/comma-style': 'warn',
'@stylistic/computed-property-spacing': 'warn',
'@stylistic/dot-location': ['warn', 'property'],
'@stylistic/eol-last': 'warn',
'@stylistic/function-call-spacing': 'warn',
'@stylistic/generator-star-spacing': 'warn',
'@stylistic/implicit-arrow-linebreak': 'warn',
'@stylistic/indent': ['warn', 2, { ignoreComments: true }],
'@stylistic/jsx-quotes': 'warn',
'@stylistic/key-spacing': 'warn',
'@stylistic/keyword-spacing': 'warn',
'@stylistic/linebreak-style': 'warn',
'@stylistic/lines-between-class-members': 'warn',
'@stylistic/member-delimiter-style': ['warn', { multiline: { delimiter: 'semi', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } }],
'@stylistic/new-parens': 'warn',
'@stylistic/no-extra-parens': ['warn', 'functions'],
'@stylistic/no-extra-semi': 'warn',
'@stylistic/no-floating-decimal': 'warn',
'@stylistic/no-mixed-spaces-and-tabs': 'warn',
'@stylistic/no-multi-spaces': ['warn', { ignoreEOLComments: true }],
'@stylistic/no-tabs': 'warn',
'@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/padding-line-between-statements': 'warn',
'@stylistic/quotes': ['warn', 'single'],
'@stylistic/rest-spread-spacing': 'warn',
'@stylistic/semi': 'warn',
'@stylistic/semi-spacing': 'warn',
'@stylistic/semi-style': 'warn',
'@stylistic/space-before-blocks': 'warn',
'@stylistic/space-in-parens': 'warn',
'@stylistic/space-infix-ops': 'warn',
'@stylistic/space-unary-ops': 'warn',
'@stylistic/switch-colon-spacing': 'warn',
'@stylistic/template-curly-spacing': 'warn',
'@stylistic/template-tag-spacing': 'warn',
'@stylistic/wrap-iife': ['warn', 'any'],
'@stylistic/yield-star-spacing': 'warn'
}
}
);