Skip to content

Commit 4820088

Browse files
committed
4.1.0 release
2 parents f45db9e + 831573c commit 4820088

File tree

5 files changed

+368
-283
lines changed

5 files changed

+368
-283
lines changed

CHANGELOG.md

+29
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22

33
The following is a curated list of changes in the Enact eslint config:
44

5+
## [4.1.0] (May 18, 2022)
6+
7+
* Replaced deprecated `babel-eslint-plugin` with `@babel/eslint-plugin` and related rules.
8+
* Replaced deprecated `no-native-reassign` rule with `no-global-assign`.
9+
* Replaced deprecated `no-negated-in-lhs` rule with `no-unsafe-negation`.
10+
* Removed `babel/quotes` rule.
11+
* Updated glob pattern for searching test files to compatible with windows.
12+
* Added `eslint-plugin-jest` dependency.
13+
* Added `jest` and `testing-library` rules for Jest unit tests validation:
14+
* `jest/no-conditional-expect` warn
15+
* `jest/no-identical-title` warn
16+
* `jest/no-jest-import` warn
17+
* `jest/valid-describe-callback` warn
18+
* `jest/valid-expect` warn
19+
* `jest/valid-expect-in-promise` warn
20+
* `jest/valid-title` warn
21+
* `testing-library/no-container` warn
22+
* `testing-library/no-debugging-utils` warn
23+
* `testing-library/no-promise-in-fire-event` warn
24+
* `testing-library/no-render-in-setup` warn
25+
* `testing-library/no-unnecessary-act` warn
26+
* `testing-library/no-wait-for-multiple-assertions` warn
27+
* `testing-library/no-wait-for-side-effects` warn
28+
* `testing-library/prefer-find-by` warn
29+
* `testing-library/prefer-presence-queries` warn
30+
* `testing-library/prefer-query-by-disappearance` warn
31+
* `testing-library/prefer-screen-queries` error
32+
* `testing-library/render-result-naming-convention` warn
33+
534
## [4.0.0] (April 11, 2022)
635

736
* Updated all dependencies including ESLint 8.

index.js

+31-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
]
3838
}
3939
},
40-
plugins: ['babel', 'jsx-a11y', 'react', 'enact'],
40+
plugins: ['@babel', 'jsx-a11y', 'react', 'enact'],
4141
settings: {
4242
react: {
4343
'pragma': 'React', // Pragma to use, default to "React"
@@ -74,8 +74,8 @@ module.exports = {
7474
'no-label-var': 'error',
7575
'no-labels': 'error',
7676
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
77-
'no-native-reassign': 'error',
78-
'no-negated-in-lhs': 'error',
77+
'no-global-assign': 'error',
78+
'no-unsafe-negation': 'error',
7979
'no-new-func': 'error',
8080
'no-new-object': 'warn',
8181
'no-new-wrappers': 'warn',
@@ -172,12 +172,12 @@ module.exports = {
172172
'react/jsx-uses-react': 'off',
173173
'react/jsx-uses-vars': 'warn',
174174

175-
// babel plugin https://github.com/babel/eslint-plugin-babel
176-
'babel/new-cap': ['error', {
175+
// babel plugin https://github.com/babel/babel/tree/main/eslint/babel-eslint-plugin
176+
'@babel/new-cap': ['error', {
177177
newIsCap: true,
178178
capIsNew: false
179179
}],
180-
'babel/no-unused-expressions': 'warn',
180+
'@babel/no-unused-expressions': 'warn',
181181

182182
// enact plugin https://github.com/enactjs/eslint-plugin-enact/
183183
'enact/no-module-exports-import': 'error'
@@ -232,25 +232,46 @@ module.exports = {
232232
// Jest unit tests
233233
files: [
234234
'**/__tests__/**/*.{js,jsx,ts,tsx}',
235-
'**/?(*.)+(spec|test).[jt]s?(x)',
235+
'**/*.+(spec|test).{js,jsx,ts,tsx}',
236236
'**/*-specs.{js,jsx,ts,tsx}'
237237
],
238-
plugins: ['testing-library'],
238+
plugins: ['jest', 'testing-library'],
239239
excludedFiles: ['tests/screenshot/**/*', 'tests/ui/**/*'],
240240
env: {
241-
jest: true
241+
'jest/globals': true
242242
},
243243
rules: {
244244
// Arrow functions can simplify tests
245245
'react/jsx-no-bind': 'off',
246246

247-
// https://github.com/testing-library/eslint-plugin-testing-library
247+
// jest plugin https://github.com/jest-community/eslint-plugin-jest
248+
'jest/no-conditional-expect': 'warn',
249+
'jest/no-identical-title': 'warn',
250+
'jest/no-jest-import': 'warn',
251+
'jest/valid-describe-callback': 'warn',
252+
'jest/valid-expect': 'warn',
253+
'jest/valid-expect-in-promise': 'warn',
254+
'jest/valid-title': 'warn',
255+
256+
// testing library plugin https://github.com/testing-library/eslint-plugin-testing-library
248257
'testing-library/await-async-query': 'error',
249258
'testing-library/await-async-utils': 'error',
250259
'testing-library/no-await-sync-query': 'warn',
251260
'testing-library/no-dom-import': ['error', 'react'],
261+
'testing-library/no-container': 'warn',
262+
'testing-library/no-debugging-utils': 'warn',
263+
'testing-library/no-promise-in-fire-event': 'warn',
264+
'testing-library/no-render-in-setup': 'warn',
265+
'testing-library/no-unnecessary-act': 'warn',
252266
'testing-library/no-wait-for-empty-callback': 'error',
267+
'testing-library/no-wait-for-multiple-assertions': 'warn',
268+
'testing-library/no-wait-for-side-effects': 'warn',
253269
'testing-library/no-wait-for-snapshot': 'error',
270+
'testing-library/prefer-find-by': 'warn',
271+
'testing-library/prefer-presence-queries': 'warn',
272+
'testing-library/prefer-query-by-disappearance': 'warn',
273+
'testing-library/prefer-screen-queries': 'error',
274+
'testing-library/render-result-naming-convention': 'warn'
254275
}
255276
},
256277
{

0 commit comments

Comments
 (0)