@zendeskgarden/eslint-config 31.0.0 → 33.0.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "33.0.0",
|
|
4
4
|
"description": "Garden ESLint config",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"eslint-plugin-node": "^11.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/core": "7.
|
|
31
|
-
"@babel/eslint-parser": "7.
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
33
|
-
"@typescript-eslint/parser": "5.
|
|
34
|
-
"eslint": "8.
|
|
35
|
-
"eslint-plugin-jest": "27.2.
|
|
30
|
+
"@babel/core": "7.22.8",
|
|
31
|
+
"@babel/eslint-parser": "7.22.7",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "5.61.0",
|
|
33
|
+
"@typescript-eslint/parser": "5.61.0",
|
|
34
|
+
"eslint": "8.44.0",
|
|
35
|
+
"eslint-plugin-jest": "27.2.2",
|
|
36
36
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
37
37
|
"eslint-plugin-node": "11.1.0",
|
|
38
38
|
"eslint-plugin-notice": "0.9.10",
|
|
39
39
|
"eslint-plugin-react": "7.32.2",
|
|
40
40
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
41
41
|
"husky": "8.0.3",
|
|
42
|
-
"jest": "29.
|
|
42
|
+
"jest": "29.6.1",
|
|
43
43
|
"prettier-package-json": "2.8.0",
|
|
44
44
|
"react": "18.2.0",
|
|
45
45
|
"standard-version": "9.5.0",
|
|
46
|
-
"typescript": "
|
|
46
|
+
"typescript": "5.1.6"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"eslint",
|
package/plugins/react.js
CHANGED
|
@@ -19,6 +19,9 @@ module.exports = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
rules: {
|
|
22
|
+
// enforces using semantic DOM elements over the ARIA role property.
|
|
23
|
+
'jsx-a11y/prefer-tag-over-role': 2,
|
|
24
|
+
|
|
22
25
|
// enforces consistent naming for boolean props
|
|
23
26
|
'react/boolean-prop-naming': 1,
|
|
24
27
|
// forbid "button" element without an explicit "type" attribute
|
|
@@ -117,8 +120,6 @@ module.exports = {
|
|
|
117
120
|
'react/jsx-props-no-multi-spaces': 2,
|
|
118
121
|
// prevent JSX prop spreading
|
|
119
122
|
'react/jsx-props-no-spreading': 0,
|
|
120
|
-
// enforce default props alphabetical sorting
|
|
121
|
-
'react/jsx-sort-default-props': 0,
|
|
122
123
|
// enforce props alphabetical sorting
|
|
123
124
|
'react/jsx-sort-props': 0,
|
|
124
125
|
// validate whitespace in and around the JSX opening and closing brackets
|
|
@@ -161,6 +162,8 @@ module.exports = {
|
|
|
161
162
|
'react/no-multi-comp': 0,
|
|
162
163
|
// enforces the absence of a namespace in React elements (e.g. `<svg:circle />`)
|
|
163
164
|
'react/no-namespace': 2,
|
|
165
|
+
// disallow usage of referential-type variables as default param in functional components
|
|
166
|
+
'react/no-object-type-as-default-prop': 0,
|
|
164
167
|
// flag shouldComponentUpdate when extending PureComponent
|
|
165
168
|
'react/no-redundant-should-component-update': 2,
|
|
166
169
|
// prevent usage of the return value of React.render
|
|
@@ -209,6 +212,8 @@ module.exports = {
|
|
|
209
212
|
'react/self-closing-comp': 2,
|
|
210
213
|
// enforce component methods order
|
|
211
214
|
'react/sort-comp': 0,
|
|
215
|
+
// enforce default props alphabetical sorting
|
|
216
|
+
'react/sort-default-props': 0,
|
|
212
217
|
// enforce propTypes declarations alphabetical sorting
|
|
213
218
|
'react/sort-prop-types': 0,
|
|
214
219
|
// state initialization in an ES6 class component should be in a constructor
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const bestPractices = require('../rules/best-practices').rules;
|
|
9
9
|
const possibleErrors = require('../rules/possible-errors').rules;
|
|
10
|
+
const stylisticIssues = require('../rules/stylistic-issues').rules;
|
|
10
11
|
|
|
11
12
|
module.exports = {
|
|
12
13
|
plugins: ['@typescript-eslint'],
|
|
@@ -14,6 +15,7 @@ module.exports = {
|
|
|
14
15
|
rules: {
|
|
15
16
|
// Disable ESLint rules that are handled by TypeScript
|
|
16
17
|
'dot-notation': 0,
|
|
18
|
+
'key-spacing': 0,
|
|
17
19
|
'no-implied-eval': 0,
|
|
18
20
|
'no-return-await': 0,
|
|
19
21
|
'no-throw-literal': 0,
|
|
@@ -23,10 +25,14 @@ module.exports = {
|
|
|
23
25
|
'@typescript-eslint/await-thenable': 2,
|
|
24
26
|
// enforce dot notation whenever possible
|
|
25
27
|
'@typescript-eslint/dot-notation': bestPractices['dot-notation'],
|
|
28
|
+
// enforce consistent spacing between keys and values in object literal properties
|
|
29
|
+
'@typescript-eslint/key-spacing': stylisticIssues['key-spacing'],
|
|
26
30
|
// requires that `.toString()` is only called on objects which provide useful information when stringified
|
|
27
31
|
'@typescript-eslint/no-base-to-string': 2,
|
|
28
32
|
// requires expressions of type void to appear in statement position
|
|
29
33
|
'@typescript-eslint/no-confusing-void-expression': 2,
|
|
34
|
+
// disallows duplicate union or intersection type members
|
|
35
|
+
'@typescript-eslint/no-duplicate-type-constituents': 2,
|
|
30
36
|
// requires Promise-like values to be handled appropriately
|
|
31
37
|
'@typescript-eslint/no-floating-promises': 2,
|
|
32
38
|
// disallow iterating over an array with a for-in loop
|
|
@@ -56,6 +62,8 @@ module.exports = {
|
|
|
56
62
|
'@typescript-eslint/no-unsafe-assignment': 2,
|
|
57
63
|
// disallows calling an any type value
|
|
58
64
|
'@typescript-eslint/no-unsafe-call': 2,
|
|
65
|
+
// disallow literals where enums are expected
|
|
66
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 2,
|
|
59
67
|
// disallows member access on any typed variables
|
|
60
68
|
'@typescript-eslint/no-unsafe-member-access': 2,
|
|
61
69
|
// disallows returning any from a function
|