@foray1010/eslint-config 6.1.2 → 6.3.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 +27 -0
- package/package.json +4 -4
- package/presets/react.js +15 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.3.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.2.0...@foray1010/eslint-config@6.3.0) (2022-04-25)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- enable testing-library/no-global-regexp-flag-in-query ([6343da2](https://github.com/foray1010/common-presets/commit/6343da2038fca9c5ef03aa2ae02129f42ff00b82))
|
|
11
|
+
- reenable testing-library/no-await-sync-events for fire events only ([966eb24](https://github.com/foray1010/common-presets/commit/966eb24ad9c3f7b15cb3c856de61516dace2075b))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **eslint-config:** use jsx-runtime config from react plugin ([806e1ab](https://github.com/foray1010/common-presets/commit/806e1ab25ac42b0bb5a269e01eef659bc12aa616))
|
|
16
|
+
|
|
17
|
+
## [6.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.1.3...@foray1010/eslint-config@6.2.0) (2022-04-05)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- enable testing-library/prefer-user-event ([5a1de13](https://github.com/foray1010/common-presets/commit/5a1de1348fbc591a35559d5710185487d6b31a87))
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- disable no-await-sync-events for @testing-library/user-event v14 ([372a3b5](https://github.com/foray1010/common-presets/commit/372a3b597f5cca2f53bbc895cd0e3da3c051263a))
|
|
26
|
+
|
|
27
|
+
### [6.1.3](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.1.2...@foray1010/eslint-config@6.1.3) (2022-03-20)
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
- **deps:** update dependency eslint-plugin-jsdoc to v38 ([294bd8b](https://github.com/foray1010/common-presets/commit/294bd8b03ee7c94e6e2fe6aad4a60c4d3654c7ca))
|
|
32
|
+
|
|
6
33
|
### [6.1.2](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.1.1...@foray1010/eslint-config@6.1.2) (2022-03-07)
|
|
7
34
|
|
|
8
35
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/eslint-config",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.3.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"eslint-plugin-import": "^2.22.1",
|
|
31
31
|
"eslint-plugin-jest": "^26.0.0",
|
|
32
32
|
"eslint-plugin-jest-dom": "^4.0.0",
|
|
33
|
-
"eslint-plugin-jsdoc": "^
|
|
33
|
+
"eslint-plugin-jsdoc": "^38.0.0",
|
|
34
34
|
"eslint-plugin-node": "^11.1.0",
|
|
35
35
|
"eslint-plugin-prettier": "^4.0.0",
|
|
36
36
|
"eslint-plugin-react": "^7.23.2",
|
|
37
37
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
38
38
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
39
|
-
"eslint-plugin-testing-library": "^5.
|
|
39
|
+
"eslint-plugin-testing-library": "^5.3.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"eslint": ">=7.28.0 <9",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "7fe04c3ba7497afa72c5cd089519ccb107925882"
|
|
52
52
|
}
|
package/presets/react.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
const { testFileGlobs } = require('./utils/testUtil')
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
|
-
extends: [
|
|
6
|
+
extends: [
|
|
7
|
+
'plugin:react/recommended',
|
|
8
|
+
'plugin:react/jsx-runtime',
|
|
9
|
+
'eslint-config-prettier',
|
|
10
|
+
],
|
|
7
11
|
parserOptions: {
|
|
8
12
|
sourceType: 'module',
|
|
9
13
|
ecmaFeatures: {
|
|
@@ -32,8 +36,6 @@ module.exports = {
|
|
|
32
36
|
],
|
|
33
37
|
// rely on typescript instead, and it does not work well with types that are imported from elsewhere
|
|
34
38
|
'react/prop-types': 'off',
|
|
35
|
-
// because we are using automatic react runtime
|
|
36
|
-
'react/react-in-jsx-scope': 'off',
|
|
37
39
|
'react-hooks/rules-of-hooks': 'error',
|
|
38
40
|
'react-hooks/exhaustive-deps': [
|
|
39
41
|
'error',
|
|
@@ -51,16 +53,18 @@ module.exports = {
|
|
|
51
53
|
plugins: ['eslint-plugin-jest-dom', 'eslint-plugin-testing-library'],
|
|
52
54
|
rules: {
|
|
53
55
|
// avoid using unnecessary `await` as workaround for `not wrapped in act(...)` warnings
|
|
54
|
-
'testing-library/no-await-sync-events':
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
'testing-library/no-await-sync-events': [
|
|
57
|
+
'error',
|
|
58
|
+
{
|
|
59
|
+
eventModules: ['fire-event'],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
// global flag /g holds state and might cause false-positives while querying for elements
|
|
63
|
+
'testing-library/no-global-regexp-flag-in-query': 'error',
|
|
58
64
|
// explicitly assert the element to prevent reader missed the test cases
|
|
59
65
|
'testing-library/prefer-explicit-assert': 'error',
|
|
60
|
-
//
|
|
61
|
-
'testing-library/prefer-
|
|
62
|
-
// using `screen` to avoid name collision
|
|
63
|
-
'testing-library/prefer-screen-queries': 'error',
|
|
66
|
+
// prefer @testing-library/user-event over fireEvent
|
|
67
|
+
'testing-library/prefer-user-event': 'error',
|
|
64
68
|
// as `wait` is deprecated
|
|
65
69
|
'testing-library/prefer-wait-for': 'error',
|
|
66
70
|
},
|