@wistia/eslint-config 0.21.1 → 0.22.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/package.json +4 -4
- package/rules/eslint/sonar.js +1 -1
- package/rules/eslint/testing-library.js +14 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Wistia's ESLint configurations",
|
|
5
5
|
"main": "react.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@typescript-eslint/parser": "^6.0.0",
|
|
40
40
|
"confusing-browser-globals": "^1.0.11",
|
|
41
41
|
"eslint": "^8.45.0",
|
|
42
|
-
"eslint-config-prettier": "^
|
|
42
|
+
"eslint-config-prettier": "^9.0.0",
|
|
43
43
|
"eslint-import-resolver-typescript": "^3.5.5",
|
|
44
44
|
"eslint-plugin-better-styled-components": "^1.1.2",
|
|
45
45
|
"eslint-plugin-cypress": "^2.13.3",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"eslint-plugin-promise": "^6.1.1",
|
|
58
58
|
"eslint-plugin-react": "^7.32.2",
|
|
59
59
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
60
|
-
"eslint-plugin-sonarjs": "^0.
|
|
60
|
+
"eslint-plugin-sonarjs": "^0.20.0",
|
|
61
61
|
"eslint-plugin-storybook": "^0.6.12",
|
|
62
62
|
"eslint-plugin-styled-components-a11y": "^2.1.3",
|
|
63
|
-
"eslint-plugin-testing-library": "^
|
|
63
|
+
"eslint-plugin-testing-library": "^6.0.0",
|
|
64
64
|
"postcss": "^8.4.26",
|
|
65
65
|
"postcss-scss": "^4.0.6",
|
|
66
66
|
"postcss-styled-syntax": "^0.4.0",
|
package/rules/eslint/sonar.js
CHANGED
|
@@ -71,7 +71,7 @@ module.exports = {
|
|
|
71
71
|
|
|
72
72
|
// String literals should not be duplicated
|
|
73
73
|
// https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-duplicate-string.md
|
|
74
|
-
'sonarjs/no-duplicate-string': ['error', 10],
|
|
74
|
+
'sonarjs/no-duplicate-string': ['error', { threshold: 10 }],
|
|
75
75
|
|
|
76
76
|
// Two branches in a conditional structure should not have exactly the same implementation
|
|
77
77
|
// https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-duplicated-branches.md
|
|
@@ -6,19 +6,18 @@ module.exports = {
|
|
|
6
6
|
plugins: ['eslint-plugin-testing-library', 'eslint-plugin-jest-dom'],
|
|
7
7
|
|
|
8
8
|
rules: {
|
|
9
|
+
// Enforce promises from async event methods are handled
|
|
10
|
+
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-events.md
|
|
11
|
+
'testing-library/await-async-events': 'error',
|
|
12
|
+
|
|
9
13
|
// Enforce promises from async queries to be handled
|
|
10
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-
|
|
11
|
-
'testing-library/await-async-
|
|
14
|
+
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-queries.md
|
|
15
|
+
'testing-library/await-async-queries': 'error',
|
|
12
16
|
|
|
13
17
|
// Enforce promises from async utils to be awaited properly
|
|
14
18
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-utils.md
|
|
15
19
|
'testing-library/await-async-utils': 'error',
|
|
16
20
|
|
|
17
|
-
// Enforce promises from `fireEvent` methods to be handled
|
|
18
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-fire-event.md
|
|
19
|
-
// only applies to Vue library
|
|
20
|
-
'testing-library/await-fire-event': 'off',
|
|
21
|
-
|
|
22
21
|
// Ensures consistent usage of `data-testid`
|
|
23
22
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/consistent-data-testid.md
|
|
24
23
|
'testing-library/consistent-data-testid': [
|
|
@@ -41,8 +40,8 @@ module.exports = {
|
|
|
41
40
|
],
|
|
42
41
|
|
|
43
42
|
// Disallow unnecessary `await` for sync queries
|
|
44
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-await-sync-
|
|
45
|
-
'testing-library/no-await-sync-
|
|
43
|
+
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-await-sync-queries.md
|
|
44
|
+
'testing-library/no-await-sync-queries': 'error',
|
|
46
45
|
|
|
47
46
|
// Disallow the use of `container` methods
|
|
48
47
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-container.md
|
|
@@ -73,17 +72,13 @@ module.exports = {
|
|
|
73
72
|
'testing-library/no-promise-in-fire-event': 'error',
|
|
74
73
|
|
|
75
74
|
// Disallow the use of `render` in testing frameworks setup functions
|
|
76
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-render-in-
|
|
77
|
-
'testing-library/no-render-in-
|
|
75
|
+
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-render-in-lifecycle.md
|
|
76
|
+
'testing-library/no-render-in-lifecycle': 'error',
|
|
78
77
|
|
|
79
78
|
// Disallow wrapping Testing Library utils or empty callbacks in `act`
|
|
80
79
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-unnecessary-act.md
|
|
81
80
|
'testing-library/no-unnecessary-act': 'error',
|
|
82
81
|
|
|
83
|
-
// Disallow empty callbacks for `waitFor` and `waitForElementToBeRemoved`
|
|
84
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-wait-for-empty-callback.md
|
|
85
|
-
'testing-library/no-wait-for-empty-callback': 'error',
|
|
86
|
-
|
|
87
82
|
// Disallow the use of multiple `expect` calls inside `waitFor`
|
|
88
83
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-wait-for-multiple-assertions.md
|
|
89
84
|
'testing-library/no-wait-for-multiple-assertions': 'error',
|
|
@@ -112,6 +107,10 @@ module.exports = {
|
|
|
112
107
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-query-by-disappearance.md
|
|
113
108
|
'testing-library/prefer-query-by-disappearance': 'error',
|
|
114
109
|
|
|
110
|
+
// Ensure the configured `get*`/`query*` query is used with the corresponding matchers
|
|
111
|
+
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-query-matchers.md
|
|
112
|
+
'testing-library/prefer-query-matchers': 'error',
|
|
113
|
+
|
|
115
114
|
// Suggest using `screen` while querying
|
|
116
115
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md
|
|
117
116
|
'testing-library/prefer-screen-queries': 'error',
|
|
@@ -120,10 +119,6 @@ module.exports = {
|
|
|
120
119
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-user-event.md
|
|
121
120
|
'testing-library/prefer-user-event': 'error',
|
|
122
121
|
|
|
123
|
-
// Use `waitFor` instead of deprecated wait methods
|
|
124
|
-
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-wait-for.md
|
|
125
|
-
'testing-library/prefer-wait-for': 'error',
|
|
126
|
-
|
|
127
122
|
// Enforce a valid naming for return value from `render`
|
|
128
123
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/render-result-naming-convention.md
|
|
129
124
|
'testing-library/render-result-naming-convention': 'error',
|