@zendeskgarden/eslint-config 25.0.0 → 27.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/package.json +12 -12
- package/plugins/jest.js +4 -2
- package/plugins/react.js +6 -0
- package/rules/stylistic-issues.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.1",
|
|
4
4
|
"description": "Garden ESLint config",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -23,26 +23,26 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@babel/eslint-parser": "^7.15.0",
|
|
26
|
-
"eslint": "^8.
|
|
26
|
+
"eslint": "^8.5.0",
|
|
27
27
|
"eslint-plugin-node": "^11.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/eslint-parser": "7.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
32
|
-
"@typescript-eslint/parser": "5.
|
|
33
|
-
"eslint": "8.
|
|
34
|
-
"eslint-plugin-jest": "
|
|
35
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
30
|
+
"@babel/eslint-parser": "7.17.0",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "5.12.0",
|
|
32
|
+
"@typescript-eslint/parser": "5.12.0",
|
|
33
|
+
"eslint": "8.9.0",
|
|
34
|
+
"eslint-plugin-jest": "26.1.0",
|
|
35
|
+
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
36
36
|
"eslint-plugin-node": "11.1.0",
|
|
37
37
|
"eslint-plugin-notice": "0.9.10",
|
|
38
|
-
"eslint-plugin-react": "7.
|
|
39
|
-
"eslint-plugin-react-hooks": "4.
|
|
38
|
+
"eslint-plugin-react": "7.28.0",
|
|
39
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
|
40
40
|
"husky": "7.0.4",
|
|
41
|
-
"jest": "27.
|
|
41
|
+
"jest": "27.5.1",
|
|
42
42
|
"prettier-package-json": "2.6.0",
|
|
43
43
|
"react": "17.0.2",
|
|
44
44
|
"standard-version": "9.3.2",
|
|
45
|
-
"typescript": "4.
|
|
45
|
+
"typescript": "4.5.5"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"eslint",
|
package/plugins/jest.js
CHANGED
|
@@ -19,6 +19,8 @@ module.exports = {
|
|
|
19
19
|
'jest/no-commented-out-tests': 2,
|
|
20
20
|
// prevent calling `expect` conditionally
|
|
21
21
|
'jest/no-conditional-expect': 0,
|
|
22
|
+
// disallow conditionals in test
|
|
23
|
+
'jest/no-conditional-in-test': 0,
|
|
22
24
|
// disallow use of deprecated functions
|
|
23
25
|
'jest/no-deprecated-functions': 2,
|
|
24
26
|
// disallow disabled tests
|
|
@@ -35,8 +37,6 @@ module.exports = {
|
|
|
35
37
|
'jest/no-hooks': 0,
|
|
36
38
|
// disallow identical titles
|
|
37
39
|
'jest/no-identical-title': 2,
|
|
38
|
-
// disallow conditional logic
|
|
39
|
-
'jest/no-if': 0,
|
|
40
40
|
// disallow string interpolation inside snapshots
|
|
41
41
|
'jest/no-interpolation-in-snapshots': 2,
|
|
42
42
|
// disallow Jasmine globals
|
|
@@ -65,6 +65,8 @@ module.exports = {
|
|
|
65
65
|
'jest/prefer-hooks-on-top': 0,
|
|
66
66
|
// enforce lowercase test names
|
|
67
67
|
'jest/prefer-lowercase-title': [1, { ignore: ['describe'] }],
|
|
68
|
+
// suggest having a hint for snapshots
|
|
69
|
+
'jest/prefer-snapshot-hint': 1,
|
|
68
70
|
// suggest using `jest.spyOn()`
|
|
69
71
|
'jest/prefer-spy-on': 0,
|
|
70
72
|
// suggest using `toStrictEqual()`
|
package/plugins/react.js
CHANGED
|
@@ -131,6 +131,8 @@ module.exports = {
|
|
|
131
131
|
'react/no-adjacent-inline-elements': 2,
|
|
132
132
|
// prevent usage of Array index in keys
|
|
133
133
|
'react/no-array-index-key': 1,
|
|
134
|
+
// lifecycle methods should be methods on the prototype, not class fields
|
|
135
|
+
'react/no-arrow-function-lifecycle': 2,
|
|
134
136
|
// prevent passing of children as props
|
|
135
137
|
'react/no-children-prop': 2,
|
|
136
138
|
// prevent usage of dangerous JSX props
|
|
@@ -147,6 +149,8 @@ module.exports = {
|
|
|
147
149
|
'react/no-direct-mutation-state': 2,
|
|
148
150
|
// prevent usage of findDOMNode
|
|
149
151
|
'react/no-find-dom-node': 2,
|
|
152
|
+
// prevent usage of invalid attributes
|
|
153
|
+
'react/no-invalid-html-attribute': 2,
|
|
150
154
|
// prevent usage of isMounted
|
|
151
155
|
'react/no-is-mounted': 2,
|
|
152
156
|
// prevent multiple component definition per file
|
|
@@ -171,6 +175,8 @@ module.exports = {
|
|
|
171
175
|
'react/no-unknown-property': 2,
|
|
172
176
|
// prevent usage of unsafe lifecycle methods
|
|
173
177
|
'react/no-unsafe': 2,
|
|
178
|
+
// Prevent declaring unused methods of component class
|
|
179
|
+
'react/no-unused-class-component-methods': 2,
|
|
174
180
|
// prevent definitions of unused prop types
|
|
175
181
|
'react/no-unused-prop-types': 2,
|
|
176
182
|
// prevent definition of unused state fields
|
|
@@ -191,6 +191,8 @@ module.exports = {
|
|
|
191
191
|
}],
|
|
192
192
|
// disallow the use of `Math.pow` in favor of the `**` operator
|
|
193
193
|
'prefer-exponentiation-operator': 1,
|
|
194
|
+
// disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`
|
|
195
|
+
'prefer-object-has-own': 1,
|
|
194
196
|
// prefer use of an object spread over `Object.assign`
|
|
195
197
|
'prefer-object-spread': 1,
|
|
196
198
|
// require quotes around object literal property names
|