@pplancq/eslint-config 4.2.3 → 5.0.1

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 CHANGED
@@ -1,3 +1,28 @@
1
+ ## @pplancq/eslint-config [5.0.1](https://github.com/pplancq/dev-tools/compare/@pplancq/eslint-config@5.0.0...@pplancq/eslint-config@5.0.1) (2025-07-21)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** update dependency eslint-plugin-testing-library to ^7.6.0 ([ef25713](https://github.com/pplancq/dev-tools/commit/ef257135f4aa22d9cc27d5568c8cc9d3831bb294))
6
+ * **deps:** update typescript-eslint mono repo to ^8.37.0 ([c059d0e](https://github.com/pplancq/dev-tools/commit/c059d0e3c377f0cf8103ae05c40960137d2ab2db))
7
+
8
+ ## @pplancq/eslint-config [5.0.0](https://github.com/pplancq/dev-tools/compare/@pplancq/eslint-config@4.2.3...@pplancq/eslint-config@5.0.0) (2025-07-14)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+
12
+ * **eslint-config:** The ESLint configuration no longer includes Jest-specific rules. Please update any dependencies or configurations that rely on these rules.
13
+ * **eslint-config:** The option `enableJest` is no longer available. If migrating to Vite, please use `enableVitest`. Alternatively, use `extendConfig` to manually apply Jest rules.
14
+ * **eslint-config:** The update enforces 'react/jsx-no-leaked-render' rule, requiring ESLint auto-fix to address leaked render issues in existing code.
15
+
16
+ ### Features
17
+
18
+ * **eslint-config:** remove jest-related eslint rules ([5bf2be6](https://github.com/pplancq/dev-tools/commit/5bf2be69b938dba3aae97d04923d93a5c5d849a9))
19
+ * **eslint-config:** update configuration to enforce 'react/jsx-no-leaked-render' rule ([7a9b451](https://github.com/pplancq/dev-tools/commit/7a9b45144f72f628bd0734aaa3b9b71ff8c288c0))
20
+
21
+ ### Bug Fixes
22
+
23
+ * **deps:** update dependency eslint-plugin-testing-library to ^7.5.4 ([55ae342](https://github.com/pplancq/dev-tools/commit/55ae342cb95b8a16e5ff51411ccc62fadd548131))
24
+ * **deps:** update typescript-eslint mono repo to ^8.36.0 ([c299492](https://github.com/pplancq/dev-tools/commit/c299492ba23b9e249ad0fe1f685b571b12423920))
25
+
1
26
  ## @pplancq/eslint-config [4.2.3](https://github.com/pplancq/dev-tools/compare/@pplancq/eslint-config@4.2.2...@pplancq/eslint-config@4.2.3) (2025-07-07)
2
27
 
3
28
  ### Bug Fixes
package/main.js CHANGED
@@ -5,7 +5,6 @@ const { reactRules, reactTypescriptRules, reactTestRules } = require('./rules/re
5
5
  const { typescriptRules } = require('./rules/typescript');
6
6
  const { prettierRules } = require('./rules/prettier');
7
7
  const { vitestRules } = require('./rules/vitest');
8
- const { jestRules } = require('./rules/jest');
9
8
  const { playwrightRules } = require('./rules/playwright');
10
9
 
11
10
  /**
@@ -17,7 +16,6 @@ const { playwrightRules } = require('./rules/playwright');
17
16
  * @param {string[]} [options.unitE2eFiles=['tests/**\/*.{test,spec}.{js,jsx,ts,tsx}']]
18
17
  * @param {boolean} [options.enableReact=false]
19
18
  * @param {boolean} [options.enableVitest=false]
20
- * @param {boolean} [options.enableJest=false] - Deprecated This option is deprecated and will be removed in the next major release. Please migrate to an alternative (e.g., Vitest).
21
19
  * @param {boolean} [options.enablePlaywright=false]
22
20
  * @param {'off' | 'on' | 'disableStyleOnly'} [options.enablePrettier='on']
23
21
  * @param {Array<import('eslint').Linter.Config>} [options.extendConfig=[]]
@@ -30,22 +28,14 @@ const defineConfig = ({
30
28
  unitE2eFiles = ['tests/**/*.{test,spec}.{js,jsx,ts,tsx}'],
31
29
  enableReact = false,
32
30
  enableVitest = false,
33
- enableJest = false,
34
31
  enablePlaywright = false,
35
32
  enablePrettier = 'off',
36
33
  extendConfig = [],
37
34
  } = {}) => {
38
- if (enableJest) {
39
- console.warn(
40
- '[DEPRECATED] The "enableJest" option is deprecated and will be removed in the next major release. Please migrate to an alternative (e.g., Vitest).',
41
- );
42
- }
43
-
44
35
  typescriptRules.files = tsFiles;
45
36
  reactTypescriptRules.files = tsFiles;
46
37
  reactTestRules.files = unitTestFiles;
47
38
  vitestRules.files = unitTestFiles;
48
- jestRules.files = unitTestFiles;
49
39
  playwrightRules.files = unitE2eFiles;
50
40
 
51
41
  if (enablePrettier === 'disableStyleOnly') {
@@ -62,7 +52,6 @@ const defineConfig = ({
62
52
  enableReact && reactTestRules,
63
53
  enablePrettier !== 'off' && prettierRules,
64
54
  enableVitest && vitestRules,
65
- enableJest && jestRules,
66
55
  enablePlaywright && playwrightRules,
67
56
  {
68
57
  files: ['eslint.config.*'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/eslint-config",
3
- "version": "4.2.3",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "description": "pplancq eslint config",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -21,19 +21,17 @@
21
21
  "config"
22
22
  ],
23
23
  "dependencies": {
24
- "@typescript-eslint/eslint-plugin": "^8.35.1",
25
- "@typescript-eslint/parser": "^8.35.1",
24
+ "@typescript-eslint/eslint-plugin": "^8.37.0",
25
+ "@typescript-eslint/parser": "^8.37.0",
26
26
  "@vitest/eslint-plugin": "^1.3.4",
27
27
  "eslint-import-resolver-typescript": "^4.4.4",
28
28
  "eslint-plugin-import": "^2.32.0",
29
- "eslint-plugin-jest": "^28.14.0",
30
29
  "eslint-plugin-jest-dom": "^5.5.0",
31
- "eslint-plugin-jest-extended": "^3.0.0",
32
30
  "eslint-plugin-jsx-a11y": "^6.10.2",
33
31
  "eslint-plugin-playwright": "^2.2.0",
34
32
  "eslint-plugin-react": "^7.37.5",
35
33
  "eslint-plugin-react-hooks": "^5.2.0",
36
- "eslint-plugin-testing-library": "^7.5.3",
34
+ "eslint-plugin-testing-library": "^7.6.0",
37
35
  "globals": "^16.3.0"
38
36
  },
39
37
  "peerDependencies": {
package/rules/react.js CHANGED
@@ -230,7 +230,7 @@ const reactRules = {
230
230
 
231
231
  // Disallow problematic leaked values from being rendered
232
232
  // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
233
- 'react/jsx-no-leaked-render': 'off',
233
+ 'react/jsx-no-leaked-render': ['error', { validStrategies: ['ternary', 'coerce'] }],
234
234
 
235
235
  // Disallow usage of string literals in JSX
236
236
  // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
package/rules/jest.js DELETED
@@ -1,294 +0,0 @@
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',
115
-
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',
119
-
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',
123
-
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',
127
-
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',
131
-
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',
135
-
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',
139
-
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',
143
-
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',
147
-
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',
151
-
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',
155
-
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',
159
-
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',
163
-
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',
167
-
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',
171
-
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',
175
-
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',
179
-
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',
183
-
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',
187
-
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',
191
-
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',
195
-
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',
199
-
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',
203
-
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',
207
-
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',
211
-
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',
215
-
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',
219
-
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',
223
-
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',
227
-
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',
231
-
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',
235
-
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',
239
-
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',
243
-
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',
247
-
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',
251
-
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',
255
-
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',
259
-
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',
263
-
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',
267
-
268
- // eslint-plugin-jest-extended https://github.com/jest-community/eslint-plugin-jest-extended
269
-
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',
273
-
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',
277
-
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',
281
-
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',
285
-
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
- };
291
-
292
- module.exports = {
293
- jestRules,
294
- };