@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/rules/jest.js CHANGED
@@ -1,289 +1,294 @@
1
- module.exports = {
2
- overrides: [
3
- {
4
- files: ['*.{test,spec,steps}.{js,jsx,ts,tsx}'],
5
- plugins: ['jest', 'jest-extended'],
6
- env: {
7
- 'jest/globals': true,
8
- },
9
- rules: {
10
- // eslint-plugin-import https://github.com/import-js/eslint-plugin-import
11
-
12
- // import/no-extraneous-dependencies
13
- // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
14
- 'import/no-extraneous-dependencies': 'off',
15
-
16
- // eslint-plugin-jest https://github.com/jest-community/eslint-plugin-jest
17
- // Enforce test and it usage conventions
18
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/consistent-test-it.md
19
- 'jest/consistent-test-it': 'off',
20
-
21
- // Enforce assertion to be made in a test body
22
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/expect-expect.md
23
- 'jest/expect-expect': 'off',
24
-
25
- // Enforces a maximum number assertion calls in a test body
26
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-expects.md
27
- 'jest/max-expects': 'off',
28
-
29
- // Enforces a maximum depth to nested describe calls
30
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-nested-describe.md
31
- 'jest/max-nested-describe': 'off',
32
-
33
- // Disallow alias methods
34
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md
35
- 'jest/no-alias-methods': 'off',
36
-
37
- // Disallow commented out tests
38
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-commented-out-tests.md
39
- 'jest/no-commented-out-tests': 'off',
40
-
41
- // Disallow calling expect conditionally
42
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md
43
- 'jest/no-conditional-expect': 'error',
44
-
45
- // Disallow conditional logic in tests
46
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-in-test.md
47
- 'jest/no-conditional-in-test': 'off',
48
-
49
- // Disallow confusing usages of jest.setTimeout
50
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-confusing-set-timeout.md
51
- 'jest/no-confusing-set-timeout': 'off',
52
-
53
- // Disallow use of deprecated functions
54
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-deprecated-functions.md
55
- 'jest/no-deprecated-functions': 'off',
56
-
57
- // Disallow disabled tests
58
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-disabled-tests.md
59
- 'jest/no-disabled-tests': 'off',
60
-
61
- // Disallow using a callback in asynchronous tests and hooks
62
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-done-callback.md
63
- 'jest/no-done-callback': 'off',
64
-
65
- // Disallow duplicate setup and teardown hooks
66
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-duplicate-hooks.md
67
- 'jest/no-duplicate-hooks': 'off',
68
-
69
- // Disallow using exports in files containing tests
70
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-export.md
71
- 'jest/no-export': 'off',
72
-
73
- // Disallow focused tests
74
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-focused-tests.md
75
- 'jest/no-focused-tests': 'off',
76
-
77
- // Disallow setup and teardown hooks
78
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-hooks.md
79
- 'jest/no-hooks': 'off',
80
-
81
- // Disallow identical titles
82
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-identical-title.md
83
- 'jest/no-identical-title': 'error',
84
-
85
- // Disallow string interpolation inside snapshots
86
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-interpolation-in-snapshots.md
87
- 'jest/no-interpolation-in-snapshots': 'error',
88
-
89
- // Disallow Jasmine globals
90
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-jasmine-globals.md
91
- 'jest/no-jasmine-globals': 'error',
92
-
93
- // Disallow large snapshots
94
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md
95
- 'jest/no-large-snapshots': 'off',
96
-
97
- // Disallow manually importing from __mocks__
98
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-mocks-import.md
99
- 'jest/no-mocks-import': 'error',
100
-
101
- // Disallow specific jest. methods
102
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-jest-methods.md
103
- 'jest/no-restricted-jest-methods': 'off',
104
-
105
- // Disallow specific matchers & modifiers
106
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-matchers.md
107
- 'jest/no-restricted-matchers': 'off',
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
- // Disallow using expect outside of it or test blocks
110
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-standalone-expect.md
111
- 'jest/no-standalone-expect': 'off',
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
- // Require using .only and .skip over f and x
114
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-prefixes.md
115
- 'jest/no-test-prefixes': 'off',
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
- // Disallow explicitly returning from tests
118
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-test-return-statement.md
119
- 'jest/no-test-return-statement': 'off',
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
- // Disallow using jest.mock() factories without an explicit type parameter
122
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-untyped-mock-factory.md
123
- 'jest/no-untyped-mock-factory': 'off',
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
- // Enforce padding around afterAll blocks
126
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-after-all-blocks.md
127
- 'jest/padding-around-after-all-blocks': 'off',
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
- // Enforce padding around afterEach blocks
130
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-after-each-blocks.md
131
- 'jest/padding-around-after-each-blocks': 'off',
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
- // Enforce padding around Jest functions
134
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-all.md
135
- 'jest/padding-around-all': 'off',
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
- // Enforce padding around beforeAll blocks
138
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-before-all-blocks.md
139
- 'jest/padding-around-before-all-blocks': 'off',
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
- // Enforce padding around beforeEach blocks
142
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-before-each-blocks.md
143
- 'jest/padding-around-before-each-blocks': 'off',
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
- // Enforce padding around describe blocks
146
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-describe-blocks.md
147
- 'jest/padding-around-describe-blocks': 'off',
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
- // Enforce padding around expect groups
150
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-expect-groups.md
151
- 'jest/padding-around-expect-groups': 'off',
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
- // Enforce padding around afterAll blocks
154
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/padding-around-test-blocks.md
155
- 'jest/padding-around-test-blocks': 'off',
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
- // Suggest using toBeCalledWith() or toHaveBeenCalledWith()
158
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-called-with.md
159
- 'jest/prefer-called-with': 'error',
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
- // Suggest using the built-in comparison matchers
162
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-comparison-matcher.md
163
- 'jest/prefer-comparison-matcher': 'off',
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
- // Prefer using .each rather than manual loops
166
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-each.md
167
- 'jest/prefer-each': 'off',
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
- // Suggest using the built-in equality matchers
170
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-equality-matcher.md
171
- 'jest/prefer-equality-matcher': 'off',
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
- // Suggest using expect.assertions() OR expect.hasAssertions()
174
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-assertions.md
175
- 'jest/prefer-expect-assertions': 'off',
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
- // Prefer await expect(...).resolves over expect(await ...) syntax
178
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-expect-resolves.md
179
- 'jest/prefer-expect-resolves': 'off',
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
- // Prefer having hooks in a consistent order
182
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-in-order.md
183
- 'jest/prefer-hooks-in-order': 'off',
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
- // Suggest having hooks before any test cases
186
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-on-top.md
187
- 'jest/prefer-hooks-on-top': 'error',
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
- // Prefer importing Jest globals
190
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-importing-jest-globals.md
191
- 'jest/prefer-importing-jest-globals': 'off',
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
- // Prefer jest.mocked() over fn as jest.Mock
194
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-jest-mocked.md
195
- 'jest/prefer-jest-mocked': 'off',
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
- // Enforce lowercase test names
198
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-lowercase-title.md
199
- 'jest/prefer-lowercase-title': 'off',
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
- // Prefer mock resolved/rejected shorthands for promises
202
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
203
- 'jest/prefer-mock-promise-shorthand': 'off',
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
- // Prefer including a hint with external snapshots
206
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-snapshot-hint.md
207
- 'jest/prefer-snapshot-hint': 'off',
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
- // Suggest using jest.spyOn()
210
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-spy-on.md
211
- 'jest/prefer-spy-on': 'off',
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
- // Suggest using toStrictEqual()
214
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-strict-equal.md
215
- 'jest/prefer-strict-equal': 'error',
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
- // Suggest using toBe() for primitive literals
218
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md
219
- 'jest/prefer-to-be': 'off',
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
- // Suggest using toContain()
222
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-contain.md
223
- 'jest/prefer-to-contain': 'error',
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
- // Suggest using toHaveLength()
226
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-have-length.md
227
- 'jest/prefer-to-have-length': 'error',
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
- // Suggest using test.todo
230
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-todo.md
231
- 'jest/prefer-todo': 'off',
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
- // Require setup and teardown code to be within a hook
234
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-hook.md
235
- 'jest/require-hook': 'off',
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
- // Require a message for toThrow()
238
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-to-throw-message.md
239
- 'jest/require-to-throw-message': 'off',
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
- // Require test cases and hooks to be inside a describe block
242
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/require-top-level-describe.md
243
- 'jest/require-top-level-describe': 'off',
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
- // Enforce unbound methods are called with their expected scope
246
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
247
- 'jest/unbound-method': 'off',
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
- // Enforce valid describe() callback
250
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-describe-callback.md
251
- 'jest/valid-describe-callback': 'error',
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
- // Enforce valid expect() usage
254
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect.md
255
- 'jest/valid-expect': 'error',
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
- // Require promises that have expectations in their chain to be valid
258
- // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/valid-expect-in-promise.md
259
- 'jest/valid-expect-in-promise': 'error',
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
- // Enforce valid titles
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
- // eslint-plugin-jest-extended https://github.com/jest-community/eslint-plugin-jest-extended
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
- // Suggest using toBeArray()
268
- // https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-array.md
269
- 'jest-extended/prefer-to-be-array': 'error',
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
- // Suggest using toBeFalse()
272
- // https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-false.md
273
- 'jest-extended/prefer-to-be-false': 'error',
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
- // Suggest using toBeObject()
276
- // https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-object.md
277
- 'jest-extended/prefer-to-be-object': 'error',
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
- // Suggest using toBeTrue()
280
- // https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-be-true.md
281
- 'jest-extended/prefer-to-be-true': 'error',
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
- // Suggest using toHaveBeenCalledOnce()
284
- // https://github.com/jest-community/eslint-plugin-jest-extended/blob/main/docs/rules/prefer-to-have-been-called-once.md
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
- module.exports = {
2
- plugins: ['prettier'],
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
+ };
@@ -1,5 +1,9 @@
1
- module.exports = {
2
- plugins: ['jsx-a11y'],
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
+ };