@zendeskgarden/eslint-config 19.0.0 → 23.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/CHANGELOG.md +95 -0
- package/package.json +14 -12
- package/plugins/jest.js +9 -7
- package/plugins/react.js +4 -0
- package/plugins/typescript-semantics.js +4 -0
- package/plugins/typescript.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,101 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [23.0.0](https://github.com/zendeskgarden/eslint-config/compare/v22.0.0...v23.0.0) (2021-10-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* **deps:** upgrade to `eslint` v8.0.0.
|
|
11
|
+
|
|
12
|
+
Plugin dependency versions:
|
|
13
|
+
- `@typescript-eslint/eslint-plugin` ^5.0.0
|
|
14
|
+
- `@typescript-eslint/parser` ^5.0.0
|
|
15
|
+
- `eslint-plugin-jest` ^25.2.0
|
|
16
|
+
- `eslint-plugin-jsx-a11y` ^6.4.0
|
|
17
|
+
- `eslint-plugin-react` ^7.26.0
|
|
18
|
+
- `eslint-plugin-react-hooks` ^4.2.0
|
|
19
|
+
|
|
20
|
+
Co-authored-by: Renovate Bot <bot@renovateapp.com>
|
|
21
|
+
Co-authored-by: Jonathan Zempel <jzempel@gmail.com>
|
|
22
|
+
* **deps:** add `jest/require-hook` rule.
|
|
23
|
+
|
|
24
|
+
Plugin dependency versions:
|
|
25
|
+
- `@typescript-eslint/eslint-plugin` ^4.33.0
|
|
26
|
+
- `eslint-plugin-jest` ^24.7.0
|
|
27
|
+
- `eslint-plugin-jsx-a11y` ^6.4.0
|
|
28
|
+
- `eslint-plugin-react` ^7.26.0
|
|
29
|
+
- `eslint-plugin-react-hooks` ^4.2.0
|
|
30
|
+
|
|
31
|
+
Co-authored-by: Renovate Bot <bot@renovateapp.com>
|
|
32
|
+
Co-authored-by: Jonathan Zempel <jzempel@gmail.com>
|
|
33
|
+
|
|
34
|
+
* **deps:** update all non-major dependencies ([#172](https://github.com/zendeskgarden/eslint-config/issues/172)) ([daf7799](https://github.com/zendeskgarden/eslint-config/commit/daf7799e4d8e5cccfa2982e6e5005bd4e8bb4332))
|
|
35
|
+
* **deps:** update dependency eslint to v8 ([#173](https://github.com/zendeskgarden/eslint-config/issues/173)) ([c22840b](https://github.com/zendeskgarden/eslint-config/commit/c22840bfb61ea2f2ce295612538b19db67bcba91))
|
|
36
|
+
|
|
37
|
+
## [22.0.0](https://github.com/zendeskgarden/eslint-config/compare/v21.0.0...v22.0.0) (2021-10-07)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### ⚠ BREAKING CHANGES
|
|
41
|
+
|
|
42
|
+
* added
|
|
43
|
+
- @typescript-eslint/no-non-null-asserted-nullish-coalescing
|
|
44
|
+
- @typescript-eslint/no-restricted-imports
|
|
45
|
+
- jest/prefer-expect-resolves
|
|
46
|
+
- jest/prefer-to-be
|
|
47
|
+
- react/no-namespace
|
|
48
|
+
* add `react/prefer-exact-props` rule.
|
|
49
|
+
|
|
50
|
+
Plugin dependency versions:
|
|
51
|
+
- `@typescript-eslint/eslint-plugin` ^4.30.0
|
|
52
|
+
- `eslint-plugin-jsx-a11y` ^6.4.0
|
|
53
|
+
- `eslint-plugin-react` ^7.25.0
|
|
54
|
+
- `eslint-plugin-react-hooks` ^4.2.0
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* add new rules for jest, react, and typescript ([#171](https://github.com/zendeskgarden/eslint-config/issues/171)) ([82f34e8](https://github.com/zendeskgarden/eslint-config/commit/82f34e8fb52b850244618e2b1417bacaaeae74f6))
|
|
59
|
+
* add react/prefer-exact-props rule ([#165](https://github.com/zendeskgarden/eslint-config/issues/165)) ([59964c6](https://github.com/zendeskgarden/eslint-config/commit/59964c684dbc2a998b194eb50fb84a56c45fde0e))
|
|
60
|
+
|
|
61
|
+
## [21.0.0](https://github.com/zendeskgarden/eslint-config/compare/v20.0.0...v21.0.0) (2021-08-17)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### ⚠ BREAKING CHANGES
|
|
65
|
+
|
|
66
|
+
* add `@typescript-eslint/prefer-return-this-type` rule.
|
|
67
|
+
|
|
68
|
+
Plugin dependency versions:
|
|
69
|
+
- `@typescript-eslint/eslint-plugin` ^4.29.0
|
|
70
|
+
- `eslint-plugin-jsx-a11y` ^6.4.0
|
|
71
|
+
- `eslint-plugin-react` ^7.22.0
|
|
72
|
+
- `eslint-plugin-react-hooks` ^4.2.0
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* add @typescript-eslint/prefer-return-this-type rule ([#161](https://github.com/zendeskgarden/eslint-config/issues/161)) ([d37238f](https://github.com/zendeskgarden/eslint-config/commit/d37238f8ec241ad7a48ee74ad756e50b3b23a36c))
|
|
77
|
+
|
|
78
|
+
## [20.0.0](https://github.com/zendeskgarden/eslint-config/compare/v19.0.0...v20.0.0) (2021-04-26)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### ⚠ BREAKING CHANGES
|
|
82
|
+
|
|
83
|
+
* add `@typescript-eslint/no-unsafe-argument` rule.
|
|
84
|
+
|
|
85
|
+
Plugin dependency versions:
|
|
86
|
+
- `@typescript-eslint/eslint-plugin` ^4.22.0
|
|
87
|
+
- `eslint-plugin-jsx-a11y` ^6.4.0
|
|
88
|
+
- `eslint-plugin-react` ^7.22.0
|
|
89
|
+
- `eslint-plugin-react-hooks` ^4.2.0
|
|
90
|
+
|
|
91
|
+
### Features
|
|
92
|
+
|
|
93
|
+
* add @typescript-eslint/no-unsafe-argument rule ([#147](https://github.com/zendeskgarden/eslint-config/issues/147)) ([5255332](https://github.com/zendeskgarden/eslint-config/commit/52553326de8e0496cf66c26bf5a650a148cd038d))
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Bug Fixes
|
|
97
|
+
|
|
98
|
+
* prevent husky from running on postinstall ([#143](https://github.com/zendeskgarden/eslint-config/issues/143)) ([40d4cca](https://github.com/zendeskgarden/eslint-config/commit/40d4cca568c7cb66ab8c0042a1dfb57a86d7e4ff))
|
|
99
|
+
|
|
5
100
|
## [19.0.0](https://github.com/zendeskgarden/eslint-config/compare/v18.0.0...v19.0.0) (2021-01-20)
|
|
6
101
|
|
|
7
102
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/eslint-config",
|
|
3
|
+
"version": "23.0.0",
|
|
3
4
|
"description": "Garden ESLint config",
|
|
4
5
|
"license": "Apache-2.0",
|
|
5
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -8,7 +9,6 @@
|
|
|
8
9
|
"bugs": {
|
|
9
10
|
"url": "https://github.com/zendeskgarden/eslint-config/issues"
|
|
10
11
|
},
|
|
11
|
-
"version": "19.0.0",
|
|
12
12
|
"main": "index.js",
|
|
13
13
|
"files": [
|
|
14
14
|
"plugins",
|
|
@@ -17,30 +17,32 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"format": "prettier-package-json --write",
|
|
19
19
|
"lint": "eslint index.js plugins/*.js rules/*.js",
|
|
20
|
+
"prepare": "husky install",
|
|
20
21
|
"tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] && standard-version --no-verify",
|
|
21
22
|
"test": "yarn lint && yarn format && git diff --quiet"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"babel-eslint": "^10.0.0",
|
|
25
|
-
"eslint": "^
|
|
26
|
+
"eslint": "^8.0.0",
|
|
26
27
|
"eslint-plugin-node": "^11.1.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "
|
|
30
|
-
"@typescript-eslint/parser": "
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "5.0.0",
|
|
31
|
+
"@typescript-eslint/parser": "5.0.0",
|
|
31
32
|
"babel-eslint": "10.1.0",
|
|
32
|
-
"eslint": "
|
|
33
|
-
"eslint-plugin-jest": "
|
|
33
|
+
"eslint": "8.0.1",
|
|
34
|
+
"eslint-plugin-jest": "25.2.1",
|
|
34
35
|
"eslint-plugin-jsx-a11y": "6.4.1",
|
|
35
36
|
"eslint-plugin-node": "11.1.0",
|
|
36
37
|
"eslint-plugin-notice": "0.9.10",
|
|
37
|
-
"eslint-plugin-react": "7.
|
|
38
|
+
"eslint-plugin-react": "7.26.1",
|
|
38
39
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
39
|
-
"husky": "
|
|
40
|
-
"jest": "
|
|
41
|
-
"prettier-package-json": "2.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
40
|
+
"husky": "7.0.2",
|
|
41
|
+
"jest": "27.2.5",
|
|
42
|
+
"prettier-package-json": "2.6.0",
|
|
43
|
+
"react": "17.0.2",
|
|
44
|
+
"standard-version": "9.3.1",
|
|
45
|
+
"typescript": "4.4.4"
|
|
44
46
|
},
|
|
45
47
|
"keywords": [
|
|
46
48
|
"eslint",
|
package/plugins/jest.js
CHANGED
|
@@ -13,8 +13,6 @@ module.exports = {
|
|
|
13
13
|
'jest/consistent-test-it': 0,
|
|
14
14
|
// enforce assertion to be made in a test body
|
|
15
15
|
'jest/expect-expect': 2,
|
|
16
|
-
// enforce lowercase test names
|
|
17
|
-
'jest/lowercase-name': [1, { ignore: ['describe'] }],
|
|
18
16
|
// disallow alias methods
|
|
19
17
|
'jest/no-alias-methods': 2,
|
|
20
18
|
// disallow commented out tests
|
|
@@ -61,28 +59,32 @@ module.exports = {
|
|
|
61
59
|
'jest/prefer-called-with': 0,
|
|
62
60
|
// suggest using `expect.assertions()` OR `expect.hasAssertions()`
|
|
63
61
|
'jest/prefer-expect-assertions': 0,
|
|
62
|
+
// suggest `await expect(...).resolves` over `expect(await ...)` syntax
|
|
63
|
+
'jest/prefer-expect-resolves': 2,
|
|
64
64
|
// suggest having hooks before any test cases
|
|
65
65
|
'jest/prefer-hooks-on-top': 0,
|
|
66
|
+
// enforce lowercase test names
|
|
67
|
+
'jest/prefer-lowercase-title': [1, { ignore: ['describe'] }],
|
|
66
68
|
// suggest using `jest.spyOn()`
|
|
67
69
|
'jest/prefer-spy-on': 0,
|
|
68
70
|
// suggest using `toStrictEqual()`
|
|
69
71
|
'jest/prefer-strict-equal': 1,
|
|
70
|
-
// suggest using `
|
|
71
|
-
'jest/prefer-to-be
|
|
72
|
-
// suggest using `toBeUndefined()`
|
|
73
|
-
'jest/prefer-to-be-undefined': 2,
|
|
72
|
+
// suggest using `toBe()` for primitive literals
|
|
73
|
+
'jest/prefer-to-be': 2,
|
|
74
74
|
// suggest using `toContain()`
|
|
75
75
|
'jest/prefer-to-contain': 2,
|
|
76
76
|
// suggest using `toHaveLength()`
|
|
77
77
|
'jest/prefer-to-have-length': 2,
|
|
78
78
|
// suggest using `test.todo`
|
|
79
79
|
'jest/prefer-todo': 1,
|
|
80
|
+
// require setup and teardown code to be within a hook
|
|
81
|
+
'jest/require-hook': 2,
|
|
80
82
|
// require a message for `toThrow()`
|
|
81
83
|
'jest/require-to-throw-message': 0,
|
|
82
84
|
// require test cases and hooks to be inside a `describe` block
|
|
83
85
|
'jest/require-top-level-describe': 2,
|
|
84
86
|
// enforce valid `describe()` callback
|
|
85
|
-
'jest/valid-describe': 2,
|
|
87
|
+
'jest/valid-describe-callback': 2,
|
|
86
88
|
// enforce valid `expect()` usage
|
|
87
89
|
'jest/valid-expect': 2,
|
|
88
90
|
// enforce having return statement when testing with promises
|
package/plugins/react.js
CHANGED
|
@@ -151,6 +151,8 @@ module.exports = {
|
|
|
151
151
|
'react/no-is-mounted': 2,
|
|
152
152
|
// prevent multiple component definition per file
|
|
153
153
|
'react/no-multi-comp': 0,
|
|
154
|
+
// enforces the absence of a namespace in React elements (e.g. `<svg:circle />`)
|
|
155
|
+
'react/no-namespace': 2,
|
|
154
156
|
// flag shouldComponentUpdate when extending PureComponent
|
|
155
157
|
'react/no-redundant-should-component-update': 2,
|
|
156
158
|
// prevent usage of the return value of React.render
|
|
@@ -177,6 +179,8 @@ module.exports = {
|
|
|
177
179
|
'react/no-will-update-set-state': 2,
|
|
178
180
|
// enforce ES5 or ES6 class for React Components
|
|
179
181
|
'react/prefer-es6-class': 2,
|
|
182
|
+
// ensure only exact prop definitions are used
|
|
183
|
+
'react/prefer-exact-props': 0,
|
|
180
184
|
// require read-only props
|
|
181
185
|
'react/prefer-read-only-props': 0,
|
|
182
186
|
// enforce stateless components to be written as a pure function
|
|
@@ -48,6 +48,8 @@ module.exports = {
|
|
|
48
48
|
'@typescript-eslint/no-unnecessary-type-arguments': 2,
|
|
49
49
|
// warns if a type assertion does not change the type of an expression
|
|
50
50
|
'@typescript-eslint/no-unnecessary-type-assertion': 2,
|
|
51
|
+
// disallows calling an function with an any type value
|
|
52
|
+
'@typescript-eslint/no-unsafe-argument': 2,
|
|
51
53
|
// disallows assigning any to variables and properties
|
|
52
54
|
'@typescript-eslint/no-unsafe-assignment': 2,
|
|
53
55
|
// disallows calling an any type value
|
|
@@ -70,6 +72,8 @@ module.exports = {
|
|
|
70
72
|
'@typescript-eslint/prefer-reduce-type-parameter': 2,
|
|
71
73
|
// enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided
|
|
72
74
|
'@typescript-eslint/prefer-regexp-exec': 1,
|
|
75
|
+
// enforce that `this` is used when only `this` type is returned
|
|
76
|
+
'@typescript-eslint/prefer-return-this-type': 2,
|
|
73
77
|
// enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings
|
|
74
78
|
'@typescript-eslint/prefer-string-starts-ends-with': 2,
|
|
75
79
|
// requires any function or method that returns a Promise to be marked async
|
package/plugins/typescript.js
CHANGED
|
@@ -45,6 +45,7 @@ module.exports = {
|
|
|
45
45
|
'no-new-symbol': 0,
|
|
46
46
|
'no-obj-calls': 0,
|
|
47
47
|
'no-redeclare': 0,
|
|
48
|
+
'no-restricted-imports': 0,
|
|
48
49
|
'no-shadow': 0,
|
|
49
50
|
'no-setter-return': 0,
|
|
50
51
|
'no-this-before-super': 0,
|
|
@@ -182,6 +183,8 @@ module.exports = {
|
|
|
182
183
|
'@typescript-eslint/no-namespace': 2,
|
|
183
184
|
// disallows using a non-null assertion after an optional chain expression
|
|
184
185
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 2,
|
|
186
|
+
// disallows using the non-null assertion on the left operand of the nullish coalescing operator
|
|
187
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 2,
|
|
185
188
|
// disallows non-null assertions using the `!` postfix operator
|
|
186
189
|
'@typescript-eslint/no-non-null-assertion': 0,
|
|
187
190
|
// disallow the use of parameter properties in class constructors
|
|
@@ -190,6 +193,8 @@ module.exports = {
|
|
|
190
193
|
'@typescript-eslint/no-redeclare': bestPractices['no-redeclare'],
|
|
191
194
|
// disallows invocation of `require()`
|
|
192
195
|
'@typescript-eslint/no-require-imports': 2,
|
|
196
|
+
// restrict usage of specified node imports
|
|
197
|
+
'@typescript-eslint/no-restricted-imports': es6['no-restricted-imports'],
|
|
193
198
|
// disallow variable declarations from shadowing variables declared in the outer scope
|
|
194
199
|
'@typescript-eslint/no-shadow': variables['no-shadow'],
|
|
195
200
|
// disallow aliasing `this`
|