@pplancq/eslint-config 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/MIGRATION.md +52 -0
- package/README.md +32 -56
- package/bin/init.js +8 -3
- package/main.js +67 -0
- package/package.json +12 -17
- package/rules/base.js +18 -11
- package/rules/import.js +14 -6
- package/rules/jest.js +248 -243
- package/rules/prettier.js +10 -2
- package/rules/react-jsx-a11y.js +10 -2
- package/rules/react.js +186 -168
- package/rules/typescript.js +567 -538
- package/rules/vitest.js +181 -173
- package/jest.js +0 -3
- package/node.js +0 -3
- package/prettier.js +0 -3
- package/react.js +0 -3
- package/vitest.js +0 -3
package/rules/jest.js
CHANGED
|
@@ -1,289 +1,294 @@
|
|
|
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
|
-
|
|
1
|
+
const jestPlugin = require('eslint-plugin-jest');
|
|
2
|
+
const jestExtendedPlugin = require('eslint-plugin-jest-extended');
|
|
3
|
+
|
|
4
|
+
const jestRules = {
|
|
5
|
+
plugins: {
|
|
6
|
+
jest: jestPlugin,
|
|
7
|
+
'jest-extended': jestExtendedPlugin,
|
|
8
|
+
},
|
|
9
|
+
languageOptions: {
|
|
10
|
+
globals: jestPlugin.environments.globals.globals,
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
// eslint-plugin-import https://github.com/import-js/eslint-plugin-import
|
|
14
|
+
|
|
15
|
+
// import/no-extraneous-dependencies
|
|
16
|
+
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
17
|
+
'import/no-extraneous-dependencies': 'off',
|
|
18
|
+
|
|
19
|
+
// eslint-plugin-jest https://github.com/jest-community/eslint-plugin-jest
|
|
20
|
+
// Enforce test and it usage conventions
|
|
21
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/consistent-test-it.md
|
|
22
|
+
'jest/consistent-test-it': 'off',
|
|
23
|
+
|
|
24
|
+
// Enforce assertion to be made in a test body
|
|
25
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/expect-expect.md
|
|
26
|
+
'jest/expect-expect': 'off',
|
|
27
|
+
|
|
28
|
+
// Enforces a maximum number assertion calls in a test body
|
|
29
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-expects.md
|
|
30
|
+
'jest/max-expects': 'off',
|
|
31
|
+
|
|
32
|
+
// Enforces a maximum depth to nested describe calls
|
|
33
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-nested-describe.md
|
|
34
|
+
'jest/max-nested-describe': 'off',
|
|
35
|
+
|
|
36
|
+
// Disallow alias methods
|
|
37
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md
|
|
38
|
+
'jest/no-alias-methods': 'off',
|
|
39
|
+
|
|
40
|
+
// Disallow commented out tests
|
|
41
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-commented-out-tests.md
|
|
42
|
+
'jest/no-commented-out-tests': 'off',
|
|
43
|
+
|
|
44
|
+
// Disallow calling expect conditionally
|
|
45
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md
|
|
46
|
+
'jest/no-conditional-expect': 'error',
|
|
47
|
+
|
|
48
|
+
// Disallow conditional logic in tests
|
|
49
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-in-test.md
|
|
50
|
+
'jest/no-conditional-in-test': 'off',
|
|
51
|
+
|
|
52
|
+
// Disallow confusing usages of jest.setTimeout
|
|
53
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-confusing-set-timeout.md
|
|
54
|
+
'jest/no-confusing-set-timeout': 'off',
|
|
55
|
+
|
|
56
|
+
// Disallow use of deprecated functions
|
|
57
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-deprecated-functions.md
|
|
58
|
+
'jest/no-deprecated-functions': 'off',
|
|
59
|
+
|
|
60
|
+
// Disallow disabled tests
|
|
61
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-disabled-tests.md
|
|
62
|
+
'jest/no-disabled-tests': 'off',
|
|
63
|
+
|
|
64
|
+
// Disallow using a callback in asynchronous tests and hooks
|
|
65
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-done-callback.md
|
|
66
|
+
'jest/no-done-callback': 'off',
|
|
67
|
+
|
|
68
|
+
// Disallow duplicate setup and teardown hooks
|
|
69
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-duplicate-hooks.md
|
|
70
|
+
'jest/no-duplicate-hooks': 'off',
|
|
71
|
+
|
|
72
|
+
// Disallow using exports in files containing tests
|
|
73
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-export.md
|
|
74
|
+
'jest/no-export': 'off',
|
|
75
|
+
|
|
76
|
+
// Disallow focused tests
|
|
77
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-focused-tests.md
|
|
78
|
+
'jest/no-focused-tests': 'off',
|
|
79
|
+
|
|
80
|
+
// Disallow setup and teardown hooks
|
|
81
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-hooks.md
|
|
82
|
+
'jest/no-hooks': 'off',
|
|
83
|
+
|
|
84
|
+
// Disallow identical titles
|
|
85
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-identical-title.md
|
|
86
|
+
'jest/no-identical-title': 'error',
|
|
87
|
+
|
|
88
|
+
// Disallow string interpolation inside snapshots
|
|
89
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
90
|
+
'jest/no-interpolation-in-snapshots': 'error',
|
|
91
|
+
|
|
92
|
+
// Disallow Jasmine globals
|
|
93
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-jasmine-globals.md
|
|
94
|
+
'jest/no-jasmine-globals': 'error',
|
|
95
|
+
|
|
96
|
+
// Disallow large snapshots
|
|
97
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md
|
|
98
|
+
'jest/no-large-snapshots': 'off',
|
|
99
|
+
|
|
100
|
+
// Disallow manually importing from __mocks__
|
|
101
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-mocks-import.md
|
|
102
|
+
'jest/no-mocks-import': 'error',
|
|
103
|
+
|
|
104
|
+
// Disallow specific jest. methods
|
|
105
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-jest-methods.md
|
|
106
|
+
'jest/no-restricted-jest-methods': 'off',
|
|
107
|
+
|
|
108
|
+
// Disallow specific matchers & modifiers
|
|
109
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-matchers.md
|
|
110
|
+
'jest/no-restricted-matchers': 'off',
|
|
111
|
+
|
|
112
|
+
// Disallow using expect outside of it or test blocks
|
|
113
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-standalone-expect.md
|
|
114
|
+
'jest/no-standalone-expect': 'off',
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
// Require using .only and .skip over f and x
|
|
117
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-prefixes.md
|
|
118
|
+
'jest/no-test-prefixes': 'off',
|
|
112
119
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
// Disallow explicitly returning from tests
|
|
121
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-return-statement.md
|
|
122
|
+
'jest/no-test-return-statement': 'off',
|
|
116
123
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
124
|
+
// Disallow using jest.mock() factories without an explicit type parameter
|
|
125
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-untyped-mock-factory.md
|
|
126
|
+
'jest/no-untyped-mock-factory': 'off',
|
|
120
127
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
// Enforce padding around afterAll blocks
|
|
129
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
130
|
+
'jest/padding-around-after-all-blocks': 'off',
|
|
124
131
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
// Enforce padding around afterEach blocks
|
|
133
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-after-each-blocks.md
|
|
134
|
+
'jest/padding-around-after-each-blocks': 'off',
|
|
128
135
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
136
|
+
// Enforce padding around Jest functions
|
|
137
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-all.md
|
|
138
|
+
'jest/padding-around-all': 'off',
|
|
132
139
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
// Enforce padding around beforeAll blocks
|
|
141
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-before-all-blocks.md
|
|
142
|
+
'jest/padding-around-before-all-blocks': 'off',
|
|
136
143
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
// Enforce padding around beforeEach blocks
|
|
145
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-before-each-blocks.md
|
|
146
|
+
'jest/padding-around-before-each-blocks': 'off',
|
|
140
147
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
// Enforce padding around describe blocks
|
|
149
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-describe-blocks.md
|
|
150
|
+
'jest/padding-around-describe-blocks': 'off',
|
|
144
151
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
152
|
+
// Enforce padding around expect groups
|
|
153
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-expect-groups.md
|
|
154
|
+
'jest/padding-around-expect-groups': 'off',
|
|
148
155
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
// Enforce padding around afterAll blocks
|
|
157
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
158
|
+
'jest/padding-around-test-blocks': 'off',
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
// Suggest using toBeCalledWith() or toHaveBeenCalledWith()
|
|
161
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-called-with.md
|
|
162
|
+
'jest/prefer-called-with': 'error',
|
|
156
163
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
// Suggest using the built-in comparison matchers
|
|
165
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
166
|
+
'jest/prefer-comparison-matcher': 'off',
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
// Prefer using .each rather than manual loops
|
|
169
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-each.md
|
|
170
|
+
'jest/prefer-each': 'off',
|
|
164
171
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
// Suggest using the built-in equality matchers
|
|
173
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
174
|
+
'jest/prefer-equality-matcher': 'off',
|
|
168
175
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
// Suggest using expect.assertions() OR expect.hasAssertions()
|
|
177
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-assertions.md
|
|
178
|
+
'jest/prefer-expect-assertions': 'off',
|
|
172
179
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
180
|
+
// Prefer await expect(...).resolves over expect(await ...) syntax
|
|
181
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
182
|
+
'jest/prefer-expect-resolves': 'off',
|
|
176
183
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
// Prefer having hooks in a consistent order
|
|
185
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
186
|
+
'jest/prefer-hooks-in-order': 'off',
|
|
180
187
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
// Suggest having hooks before any test cases
|
|
189
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
190
|
+
'jest/prefer-hooks-on-top': 'error',
|
|
184
191
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
192
|
+
// Prefer importing Jest globals
|
|
193
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-importing-jest-globals.md
|
|
194
|
+
'jest/prefer-importing-jest-globals': 'off',
|
|
188
195
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
// Prefer jest.mocked() over fn as jest.Mock
|
|
197
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-jest-mocked.md
|
|
198
|
+
'jest/prefer-jest-mocked': 'off',
|
|
192
199
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
// Enforce lowercase test names
|
|
201
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
202
|
+
'jest/prefer-lowercase-title': 'off',
|
|
196
203
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
// Prefer mock resolved/rejected shorthands for promises
|
|
205
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
206
|
+
'jest/prefer-mock-promise-shorthand': 'off',
|
|
200
207
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
208
|
+
// Prefer including a hint with external snapshots
|
|
209
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
210
|
+
'jest/prefer-snapshot-hint': 'off',
|
|
204
211
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
// Suggest using jest.spyOn()
|
|
213
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-spy-on.md
|
|
214
|
+
'jest/prefer-spy-on': 'off',
|
|
208
215
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
216
|
+
// Suggest using toStrictEqual()
|
|
217
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-strict-equal.md
|
|
218
|
+
'jest/prefer-strict-equal': 'error',
|
|
212
219
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
// Suggest using toBe() for primitive literals
|
|
221
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md
|
|
222
|
+
'jest/prefer-to-be': 'off',
|
|
216
223
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
// Suggest using toContain()
|
|
225
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-contain.md
|
|
226
|
+
'jest/prefer-to-contain': 'error',
|
|
220
227
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
228
|
+
// Suggest using toHaveLength()
|
|
229
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-have-length.md
|
|
230
|
+
'jest/prefer-to-have-length': 'error',
|
|
224
231
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
232
|
+
// Suggest using test.todo
|
|
233
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-todo.md
|
|
234
|
+
'jest/prefer-todo': 'off',
|
|
228
235
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
// Require setup and teardown code to be within a hook
|
|
237
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-hook.md
|
|
238
|
+
'jest/require-hook': 'off',
|
|
232
239
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
240
|
+
// Require a message for toThrow()
|
|
241
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-to-throw-message.md
|
|
242
|
+
'jest/require-to-throw-message': 'off',
|
|
236
243
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
// Require test cases and hooks to be inside a describe block
|
|
245
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
|
|
246
|
+
'jest/require-top-level-describe': 'off',
|
|
240
247
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
248
|
+
// Enforce unbound methods are called with their expected scope
|
|
249
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
|
|
250
|
+
'jest/unbound-method': 'off',
|
|
244
251
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
252
|
+
// Enforce valid describe() callback
|
|
253
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-describe-callback.md
|
|
254
|
+
'jest/valid-describe-callback': 'error',
|
|
248
255
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
256
|
+
// Enforce valid expect() usage
|
|
257
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect.md
|
|
258
|
+
'jest/valid-expect': 'error',
|
|
252
259
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
260
|
+
// Require promises that have expectations in their chain to be valid
|
|
261
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect-in-promise.md
|
|
262
|
+
'jest/valid-expect-in-promise': 'error',
|
|
256
263
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
264
|
+
// Enforce valid titles
|
|
265
|
+
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-title.md
|
|
266
|
+
'jest/valid-title': 'error',
|
|
260
267
|
|
|
261
|
-
|
|
262
|
-
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-title.md
|
|
263
|
-
'jest/valid-title': 'error',
|
|
268
|
+
// eslint-plugin-jest-extended https://github.com/jest-community/eslint-plugin-jest-extended
|
|
264
269
|
|
|
265
|
-
|
|
270
|
+
// Suggest using toBeArray()
|
|
271
|
+
// https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-array.md
|
|
272
|
+
'jest-extended/prefer-to-be-array': 'error',
|
|
266
273
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
274
|
+
// Suggest using toBeFalse()
|
|
275
|
+
// https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-false.md
|
|
276
|
+
'jest-extended/prefer-to-be-false': 'error',
|
|
270
277
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
278
|
+
// Suggest using toBeObject()
|
|
279
|
+
// https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-object.md
|
|
280
|
+
'jest-extended/prefer-to-be-object': 'error',
|
|
274
281
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
282
|
+
// Suggest using toBeTrue()
|
|
283
|
+
// https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-true.md
|
|
284
|
+
'jest-extended/prefer-to-be-true': 'error',
|
|
278
285
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
// Suggest using toHaveBeenCalledOnce()
|
|
287
|
+
// https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-have-been-called-once.md
|
|
288
|
+
'jest-extended/prefer-to-have-been-called-once': 'error',
|
|
289
|
+
},
|
|
290
|
+
};
|
|
282
291
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
'jest-extended/prefer-to-have-been-called-once': 'error',
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
],
|
|
292
|
+
module.exports = {
|
|
293
|
+
jestRules,
|
|
289
294
|
};
|
package/rules/prettier.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const prettierPlugin = require('eslint-plugin-prettier');
|
|
2
|
+
|
|
3
|
+
const prettierRules = {
|
|
4
|
+
plugins: {
|
|
5
|
+
prettier: prettierPlugin,
|
|
6
|
+
},
|
|
3
7
|
rules: {
|
|
4
8
|
// eslint-plugin-prettier https://github.com/prettier/eslint-plugin-prettier
|
|
5
9
|
'prettier/prettier': 'error',
|
|
@@ -130,3 +134,7 @@ module.exports = {
|
|
|
130
134
|
'yield-star-spacing': 'off',
|
|
131
135
|
},
|
|
132
136
|
};
|
|
137
|
+
|
|
138
|
+
module.exports = {
|
|
139
|
+
prettierRules,
|
|
140
|
+
};
|
package/rules/react-jsx-a11y.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const jsxA11yPlugin = require('eslint-plugin-jsx-a11y');
|
|
2
|
+
|
|
3
|
+
const reactJsxA11yRules = {
|
|
4
|
+
plugins: {
|
|
5
|
+
'jsx-a11y': jsxA11yPlugin,
|
|
6
|
+
},
|
|
3
7
|
rules: {
|
|
4
8
|
// eslint-plugin-jsx-a11y https://github.com/jsx-eslint/eslint-plugin-jsx-a11y?tab=readme-ov-file
|
|
5
9
|
|
|
@@ -214,3 +218,7 @@ module.exports = {
|
|
|
214
218
|
'jsx-a11y/tabindex-no-positive': 'error',
|
|
215
219
|
},
|
|
216
220
|
};
|
|
221
|
+
|
|
222
|
+
module.exports = {
|
|
223
|
+
reactJsxA11yRules,
|
|
224
|
+
};
|