@zendeskgarden/eslint-config 40.0.0 → 42.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/README.md CHANGED
@@ -1,11 +1,9 @@
1
- # Garden ESLint Config [![npm version][npm version badge]][npm version link] [![Build Status][build status badge]][build status link] [![Dependency Status][dependency status badge]][dependency status link]
1
+ # Garden ESLint Config [![npm version][npm version badge]][npm version link] [![Build Status][build status badge]][build status link]
2
2
 
3
3
  [npm version badge]: https://flat.badgen.net/npm/v/@zendeskgarden/eslint-config
4
4
  [npm version link]: https://www.npmjs.com/package/@zendeskgarden/eslint-config
5
5
  [build status badge]: https://flat.badgen.net/circleci/github/zendeskgarden/eslint-config/main?label=build
6
6
  [build status link]: https://circleci.com/gh/zendeskgarden/eslint-config/tree/main
7
- [dependency status badge]: https://flat.badgen.net/david/dev/zendeskgarden/eslint-config?label=dependencies
8
- [dependency status link]: https://david-dm.org/zendeskgarden/eslint-config?type=dev
9
7
 
10
8
  > :seedling: Garden is the design system by Zendesk
11
9
 
@@ -16,22 +14,22 @@ selection of associated [plugins](#plugins).
16
14
  ## Installation
17
15
 
18
16
  ```sh
19
- npm install eslint @babel/eslint-parser eslint-plugin-node @zendeskgarden/eslint-config
17
+ npm install eslint @zendeskgarden/eslint-config
20
18
  ```
21
19
 
22
20
  ## Usage
23
21
 
24
- Add a `.eslintrc.json` to your project with an `extends` property like this:
22
+ Add a `eslint.config.mjs` to your project like this:
25
23
 
26
- ```json
27
- {
28
- "extends": "@zendeskgarden"
29
- }
24
+ ```js
25
+ import config from '@zendeskgarden/eslint-config';
26
+
27
+ export default config;
30
28
  ```
31
29
 
32
30
  Now Garden linting rules will apply to your project. See the [ESLint
33
- Documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
34
- for more details on extending shareable configuration files.
31
+ Documentation](https://eslint.org/docs/latest/extend/shareable-configs#using-a-shareable-config)
32
+ for more details on using shareable configuration files.
35
33
 
36
34
  ### Plugins
37
35
 
@@ -43,104 +41,102 @@ Install the following dependency in addition to those [listed](#installation)
43
41
  above.
44
42
 
45
43
  ```sh
46
- npm install jest eslint-plugin-jest
44
+ npm install jest
47
45
  ```
48
46
 
49
- Extend the base configuration.
47
+ Update the default configuration.
48
+
49
+ ```js
50
+ import config from '@zendeskgarden/eslint-config';
51
+ import jestPlugin from '@zendeskgarden/eslint-config/plugins/jest.js';
50
52
 
51
- ```json
52
- {
53
- "extends": ["@zendeskgarden", "@zendeskgarden/eslint-config/plugins/jest"]
54
- }
53
+ export default [...config, jestPlugin];
55
54
  ```
56
55
 
57
56
  In some cases, it may be useful to limit the scope of the Jest rules via
58
- `overrides`.
59
-
60
- ```json
61
- {
62
- "extends": "@zendeskgarden",
63
- "overrides": [
64
- {
65
- "files": ["*.spec.*"],
66
- "extends": "@zendeskgarden/eslint-config/plugins/jest"
67
- }
68
- ]
69
- }
57
+ `files`.
58
+
59
+ ```js
60
+ export default [
61
+ ...config,
62
+ {
63
+ files: ['**/*.spec.*'],
64
+ ...jestPlugin
65
+ }
66
+ ];
70
67
  ```
71
68
 
72
69
  #### React
73
70
 
74
71
  The React plugin bundles rules for React, React Hooks, and JSX accessibility.
75
- Install the following dependencies in addition to those
76
- [listed](#installation) above.
72
+ Install the following dependency in addition to those [listed](#installation)
73
+ above.
77
74
 
78
75
  ```sh
79
- npm install eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
76
+ npm install react
80
77
  ```
81
78
 
82
- Extend the base configuration.
79
+ Update the default configuration.
80
+
81
+ ```js
82
+ import config from '@zendeskgarden/eslint-config';
83
+ import reactPlugin from '@zendeskgarden/eslint-config/plugins/react.js';
83
84
 
84
- ```json
85
- {
86
- "extends": ["@zendeskgarden", "@zendeskgarden/eslint-config/plugins/react"]
87
- }
85
+ export default [...config, reactPlugin];
88
86
  ```
89
87
 
90
88
  #### TypeScript
91
89
 
92
- Install the following dependencies in addition to those
93
- [listed](#installation) above.
90
+ Install the following dependency in addition to those [listed](#installation)
91
+ above.
94
92
 
95
93
  ```sh
96
- npm install typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
94
+ npm install typescript
97
95
  ```
98
96
 
99
- Extend the base configuration.
97
+ Update the default configuration.
98
+
99
+ ```js
100
+ import config from '@zendeskgarden/eslint-config';
101
+ import typescriptPlugin from '@zendeskgarden/eslint-config/plugins/typescript.js';
100
102
 
101
- ```json
102
- {
103
- "extends": [
104
- "@zendeskgarden",
105
- "@zendeskgarden/eslint-config/plugins/typescript"
106
- ]
107
- }
103
+ export default [...config, typescriptPlugin];
108
104
  ```
109
105
 
110
106
  For mixed JS and TS codebases, it may be useful to limit the scope of the
111
- TypeScript rules via `overrides`.
112
-
113
- ```json
114
- {
115
- "extends": "@zendeskgarden",
116
- "overrides": [
117
- {
118
- "files": ["*.ts", "*.tsx"],
119
- "extends": "@zendeskgarden/eslint-config/plugins/typescript"
120
- }
121
- ]
122
- }
107
+ TypeScript rules via `files`.
108
+
109
+ ```js
110
+ export default [
111
+ ...config,
112
+ {
113
+ files: ['**/*.{ts, tsx}'],
114
+ ...typescriptPlugin
115
+ }
116
+ ];
123
117
  ```
124
118
 
125
119
  The `typescript` plugin covers rules for syntax checking. An additional
126
- `typescript-semantics` plugin provides rules based on semantics. The
127
- `typescript-semantics` plugin requires type information in order to execute.
128
- Set `parserOptions.project` to a valid TSConfig for the project. See
129
- [typescript-eslint
130
- documentation](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md)
120
+ `typescript-type-checked` plugin provides rules based on semantics. The
121
+ `typescript-type-checked` plugin requires type information in order to execute.
122
+ Set `languageOptions.parserOptions.project` to a valid TSConfig for the project. See
123
+ [typescript-eslint documentation](https://typescript-eslint.io/getting-started/typed-linting)
131
124
  for details.
132
125
 
133
- ```json
134
- {
135
- "extends": [
136
- "@zendeskgarden",
137
- "@zendeskgarden/eslint-config/plugins/typescript",
138
- "@zendeskgarden/eslint-config/plugins/typescript-semantics"
139
- ],
140
- "parserOptions": {
141
- "project": ["./tsconfig.json"]
126
+ ```js
127
+ export default [
128
+ ...config,
129
+ typescriptPlugin,
130
+ typescriptTypeCheckedPlugin,
131
+ {
132
+ languageOptions: {
133
+ parserOptions: {
134
+ project: ['./tsconfig.json'],
135
+ requireConfigFile: false
136
+ }
137
+ }
142
138
  }
143
- }
139
+ ];
144
140
  ```
145
141
 
146
142
  ## Resources
@@ -167,6 +163,6 @@ conduct](.github/CODE_OF_CONDUCT.md). Please participate accordingly.
167
163
 
168
164
  ## License
169
165
 
170
- Copyright 2021 Zendesk
166
+ Copyright 2024 Zendesk
171
167
 
172
168
  Licensed under the [Apache License, Version 2.0](LICENSE.md)
package/index.js CHANGED
@@ -5,34 +5,38 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
 
8
- module.exports = {
9
- extends: [
10
- './rules/possible-errors',
11
- './rules/best-practices',
12
- './rules/strict-mode',
13
- './rules/variables',
14
- './rules/stylistic-issues',
15
- './rules/es6',
16
- './plugins/node/possible-errors',
17
- './plugins/node/best-practices',
18
- './plugins/node/stylistic-issues'
19
- ].map(require.resolve),
20
- parser: '@babel/eslint-parser',
21
- env: {
22
- browser: true,
23
- es2020: true,
24
- node: true
25
- },
26
- parserOptions: {
27
- sourceType: 'module',
28
- ecmaFeatures: {
29
- // allow `return` statements in the global scope
30
- globalReturn: false,
31
- // enable global strict mode
32
- impliedStrict: true,
33
- // enable JSX
34
- jsx: true
8
+ import babelParser from '@babel/eslint-parser';
9
+ import eslintLayoutFormatting from './rules/layout-formatting.js';
10
+ import eslintPossibleProblems from './rules/possible-problems.js';
11
+ import eslintSuggestions from './rules/suggestions.js';
12
+ import globals from 'globals';
13
+ import nodePlugin from './plugins/node.js';
14
+
15
+ export default [
16
+ eslintLayoutFormatting,
17
+ eslintPossibleProblems,
18
+ eslintSuggestions,
19
+ nodePlugin,
20
+ {
21
+ languageOptions: {
22
+ globals: {
23
+ ...globals.browser,
24
+ ...globals.es2020
25
+ },
26
+ parser: babelParser,
27
+ parserOptions: {
28
+ ecmaFeatures: {
29
+ // allow `return` statements in the global scope
30
+ globalReturn: false,
31
+ // enable global strict mode
32
+ impliedStrict: true,
33
+ // enable JSX
34
+ jsx: true
35
+ }
36
+ }
37
+ },
38
+ linterOptions: {
39
+ reportUnusedDisableDirectives: true
35
40
  }
36
- },
37
- reportUnusedDisableDirectives: true
38
- };
41
+ }
42
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/eslint-config",
3
- "version": "40.0.0",
3
+ "version": "42.0.0",
4
4
  "description": "Garden ESLint config",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -9,6 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/zendeskgarden/eslint-config/issues"
11
11
  },
12
+ "type": "module",
12
13
  "main": "index.js",
13
14
  "files": [
14
15
  "plugins",
@@ -16,28 +17,29 @@
16
17
  ],
17
18
  "scripts": {
18
19
  "format": "prettier-package-json --write",
19
- "lint": "eslint index.js plugins/*.js rules/*.js --max-warnings 0",
20
+ "lint": "eslint eslint.config.js index.js plugins/*.js rules/*.js --max-warnings 0",
20
21
  "prepare": "husky",
21
22
  "tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] && standard-version --no-verify",
22
23
  "test": "npm run format && npm run lint && git diff --quiet"
23
24
  },
25
+ "dependencies": {
26
+ "@babel/eslint-parser": "7.24.7",
27
+ "@eslint/compat": "1.1.0",
28
+ "eslint-plugin-jest": "28.6.0",
29
+ "eslint-plugin-jsx-a11y": "6.9.0",
30
+ "eslint-plugin-n": "17.9.0",
31
+ "eslint-plugin-notice": "1.0.0",
32
+ "eslint-plugin-react": "7.34.3",
33
+ "eslint-plugin-react-hooks": "4.6.2",
34
+ "globals": "15.6.0",
35
+ "typescript-eslint": "7.13.1"
36
+ },
24
37
  "peerDependencies": {
25
- "@babel/eslint-parser": "^7.15.0",
26
- "eslint": "^8.56.0",
27
- "eslint-plugin-n": "^17.0.0"
38
+ "eslint": "^9.0.0"
28
39
  },
29
40
  "devDependencies": {
30
- "@babel/core": "7.24.5",
31
- "@babel/eslint-parser": "7.24.5",
32
- "@typescript-eslint/eslint-plugin": "7.8.0",
33
- "@typescript-eslint/parser": "7.8.0",
34
- "eslint": "8.57.0",
35
- "eslint-plugin-jest": "28.5.0",
36
- "eslint-plugin-jsx-a11y": "6.8.0",
37
- "eslint-plugin-n": "17.6.0",
38
- "eslint-plugin-notice": "0.9.10",
39
- "eslint-plugin-react": "7.34.1",
40
- "eslint-plugin-react-hooks": "4.6.2",
41
+ "@babel/core": "7.24.7",
42
+ "eslint": "9.5.0",
41
43
  "husky": "9.0.11",
42
44
  "jest": "29.7.0",
43
45
  "prettier-package-json": "2.8.0",
package/plugins/jest.js CHANGED
@@ -5,14 +5,25 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
 
8
- module.exports = {
9
- plugins: ['jest'],
10
- env: { 'jest/globals': true },
8
+ import globals from 'globals';
9
+ import jestPlugin from 'eslint-plugin-jest';
10
+
11
+ export default {
12
+ plugins: {
13
+ jest: jestPlugin
14
+ },
15
+ languageOptions: {
16
+ globals: globals.jest
17
+ },
11
18
  rules: {
12
19
  // have control over `test` and `it` usages
13
20
  'jest/consistent-test-it': 0,
14
21
  // enforce assertion to be made in a test body
15
22
  'jest/expect-expect': 2,
23
+ // enforces a maximum number assertion calls in a test body
24
+ 'max-expects': 0,
25
+ // enforces a maximum depth to nested describe calls
26
+ 'max-nested-describe': 0,
16
27
  // disallow alias methods
17
28
  'jest/no-alias-methods': 2,
18
29
  // disallow commented out tests
@@ -21,6 +32,8 @@ module.exports = {
21
32
  'jest/no-conditional-expect': 0,
22
33
  // disallow conditionals in test
23
34
  'jest/no-conditional-in-test': 0,
35
+ // isallow confusing usages of jest.setTimeout
36
+ 'jest/no-confusing-set-timeout': 2,
24
37
  // disallow use of deprecated functions
25
38
  'jest/no-deprecated-functions': 2,
26
39
  // disallow disabled tests
@@ -45,6 +58,8 @@ module.exports = {
45
58
  'jest/no-large-snapshots': 0,
46
59
  // disallow manually importing from `__mocks__`
47
60
  'jest/no-mocks-import': 2,
61
+ // disallow specific `jest.` methods
62
+ 'jest/no-restricted-jest-methods': 0,
48
63
  // disallow specific matchers & modifiers
49
64
  'jest/no-restricted-matchers': 0,
50
65
  // disallow using `expect` outside of `it` or `test` blocks
@@ -57,16 +72,28 @@ module.exports = {
57
72
  'jest/no-untyped-mock-factory': 2,
58
73
  // suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`
59
74
  'jest/prefer-called-with': 0,
75
+ // suggest using the built-in comparison matchers
76
+ 'jest/prefer-comparison-matcher': 2,
60
77
  // prefer using `.each` rather than manual loops
61
78
  'jest/prefer-each': 2,
79
+ // suggest using the built-in equality matchers
80
+ 'jest/prefer-equality-matcher': 2,
62
81
  // suggest using `expect.assertions()` OR `expect.hasAssertions()`
63
82
  'jest/prefer-expect-assertions': 0,
64
83
  // suggest `await expect(...).resolves` over `expect(await ...)` syntax
65
84
  'jest/prefer-expect-resolves': 2,
85
+ // prefer having hooks in a consistent order
86
+ 'jest/prefer-hooks-in-order': 2,
66
87
  // suggest having hooks before any test cases
67
88
  'jest/prefer-hooks-on-top': 0,
89
+ // prefer importing Jest globals
90
+ 'jest/prefer-importing-jest-globals': 0,
91
+ // prefer `jest.mocked()` over `fn as jest.Mock`
92
+ 'jest/prefer-jest-mocked': 2,
68
93
  // enforce lowercase test names
69
94
  'jest/prefer-lowercase-title': [1, { ignore: ['describe'] }],
95
+ // prefer mock resolved/rejected shorthands for promises
96
+ 'jest/prefer-mock-promise-shorthand': 1,
70
97
  // suggest having a hint for snapshots
71
98
  'jest/prefer-snapshot-hint': 1,
72
99
  // suggest using `jest.spyOn()`
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+
8
+ import globals from 'globals';
9
+ import nodePlugin from 'eslint-plugin-n';
10
+
11
+ export default {
12
+ plugins: {
13
+ n: nodePlugin
14
+ },
15
+ languageOptions: {
16
+ globals: globals.node
17
+ },
18
+ rules: {
19
+ // enforce `return` after a callback
20
+ 'n/callback-return': 0,
21
+ // enforce either `module.exports` or `exports`
22
+ 'n/exports-style': 0,
23
+ // enforce the style of file extensions in `import` declarations
24
+ 'n/file-extension-in-import': 0,
25
+ // enforce `require()` on top-level module scope
26
+ 'n/global-require': 1,
27
+ // require error handling in callbacks
28
+ 'n/handle-callback-err': 0,
29
+ // suggest correct usage of hashbang
30
+ 'n/hashbang': 0,
31
+ // ensure Node.js-style error-first callback pattern is followed
32
+ 'n/no-callback-literal': 1,
33
+ // disallow deprecated APIs
34
+ 'n/no-deprecated-api': 2,
35
+ // disallow the assignment to `exports`
36
+ 'n/no-exports-assign': 2,
37
+ // disallow `import` declarations which import extraneous modules
38
+ 'n/no-extraneous-import': 0,
39
+ // disallow `require()` expressions which import extraneous modules
40
+ 'n/no-extraneous-require': 0,
41
+ // disallow `import` declarations which import non-existence modules
42
+ 'n/no-missing-import': 0,
43
+ // disallow `require()` expressions which import non-existence modules
44
+ 'n/no-missing-require': 2,
45
+ // disallow mixing regular variable and `require` declarations
46
+ 'n/no-mixed-requires': [0, false],
47
+ // disallow `new` operators with calls to `require`
48
+ 'n/no-new-require': 0,
49
+ // disallow string concatenation with `__dirname` and `__filename`
50
+ 'n/no-path-concat': 2,
51
+ // disallow use of `process.env`
52
+ 'n/no-process-env': 0,
53
+ // disallow `process.exit()`
54
+ 'n/no-process-exit': 2,
55
+ // disallow specified modules when loaded by `import` declarations
56
+ 'n/no-restricted-import': 0,
57
+ // disallow specified modules when loaded by `require`
58
+ 'n/no-restricted-require': 0,
59
+ // disallow use of synchronous methods
60
+ 'n/no-sync': 0,
61
+ // disallow `bin` files that npm ignores
62
+ 'n/no-unpublished-bin': 2,
63
+ // disallow `import` declarations which import private modules
64
+ 'n/no-unpublished-import': 0,
65
+ // disallow `require()` expressions which import private modules
66
+ 'n/no-unpublished-require': 0,
67
+ // disallow unsupported ECMAScript built-ins on the specified version
68
+ 'n/no-unsupported-features/es-builtins': 2,
69
+ // disallow unsupported ECMAScript syntax on the specified version
70
+ 'n/no-unsupported-features/es-syntax': 0,
71
+ // disallow unsupported Node.js built-in APIs on the specified version
72
+ 'n/no-unsupported-features/node-builtins': 2,
73
+ // enforce either `Buffer` or `require("buffer").Buffer`
74
+ 'n/prefer-global/buffer': [2, 'always'],
75
+ // enforce either `console` or `require("console")`
76
+ 'n/prefer-global/console': [2, 'always'],
77
+ // enforce either `process` or `require("process")`
78
+ 'n/prefer-global/process': [2, 'always'],
79
+ // enforce either `TextDecoder` or `require("util").TextDecoder`
80
+ 'n/prefer-global/text-decoder': [2, 'always'],
81
+ // enforce either `TextEncoder` or `require("util").TextEncoder`
82
+ 'n/prefer-global/text-encoder': [2, 'always'],
83
+ // enforce either `URL` or `require("url").URL`
84
+ 'n/prefer-global/url': [2, 'always'],
85
+ // enforce either `URLSearchParams` or `require("url").URLSearchParams`
86
+ 'n/prefer-global/url-search-params': [2, 'always'],
87
+ // enforce using the `node:` protocol when importing Node.js builtin modules
88
+ 'n/prefer-node-protocol': [2, { version: '>=16.0.0' }],
89
+ // enforce `require("dns").promises`
90
+ 'n/prefer-promises/dns': 1,
91
+ // enforce `require("fs").promises`
92
+ 'n/prefer-promises/fs': 1,
93
+ // make process.exit() expressions the same code path as throw
94
+ 'n/process-exit-as-throw': 2
95
+ }
96
+ };
package/plugins/notice.js CHANGED
@@ -7,13 +7,20 @@ const TEMPLATE = `/**
7
7
 
8
8
  `;
9
9
 
10
- module.exports = {
11
- plugins: ['notice'],
10
+ import noticePlugin from 'eslint-plugin-notice';
11
+
12
+ export default {
13
+ plugins: {
14
+ notice: noticePlugin
15
+ },
12
16
  rules: {
13
17
  // throw an error when a file doesn't have a copyright notice
14
- 'notice/notice': [2, {
15
- template: TEMPLATE,
16
- onNonMatchingHeader: 'replace'
17
- }]
18
+ 'notice/notice': [
19
+ 2,
20
+ {
21
+ template: TEMPLATE,
22
+ onNonMatchingHeader: 'replace'
23
+ }
24
+ ]
18
25
  }
19
26
  };
package/plugins/react.js CHANGED
@@ -5,12 +5,23 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
 
8
- module.exports = {
9
- plugins: ['react', 'react-hooks', 'jsx-a11y'],
10
- extends: ['plugin:jsx-a11y/recommended'],
11
- parserOptions: {
12
- ecmaFeatures: {
13
- jsx: true
8
+ import { fixupPluginRules } from '@eslint/compat';
9
+ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
10
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
11
+ import reactPlugin from 'eslint-plugin-react';
12
+
13
+ export default {
14
+ plugins: {
15
+ react: reactPlugin,
16
+ // TODO remove fixup when eslint-plugin-react-hooks 5.x is released
17
+ 'react-hooks': fixupPluginRules(reactHooksPlugin),
18
+ 'jsx-a11y': jsxA11yPlugin
19
+ },
20
+ languageOptions: {
21
+ parserOptions: {
22
+ ecmaFeatures: {
23
+ jsx: true
24
+ }
14
25
  }
15
26
  },
16
27
  settings: {
@@ -19,6 +30,9 @@ module.exports = {
19
30
  }
20
31
  },
21
32
  rules: {
33
+ ...jsxA11yPlugin.configs.recommended.rules,
34
+ // disallow `aria-hidden="true"` from being set on focusable elements
35
+ 'jsx-a11y/no-aria-hidden-on-focusable': 2,
22
36
  // enforces using semantic DOM elements over the ARIA role property.
23
37
  'jsx-a11y/prefer-tag-over-role': 2,
24
38
 
@@ -26,6 +40,8 @@ module.exports = {
26
40
  'react/boolean-prop-naming': 1,
27
41
  // forbid "button" element without an explicit "type" attribute
28
42
  'react/button-has-type': 2,
43
+ // enforce using `onChange` or `readonly` attribute when checked is used
44
+ 'react/checked-requires-onchange-or-readonly': 2,
29
45
  // enforce all defaultProps are defined and not "required" in propTypes
30
46
  'react/default-props-match-prop-types': 0,
31
47
  // enforce consistent usage of destructuring assignment of props, state, and context
@@ -102,6 +118,8 @@ module.exports = {
102
118
  'react/jsx-no-constructed-context-values': 2,
103
119
  // enforce no duplicate props
104
120
  'react/jsx-no-duplicate-props': 2,
121
+ // disallow problematic leaked values from being rendered
122
+ 'react/jsx-no-leaked-render': 2,
105
123
  // prevent using string literals in React component definition
106
124
  'react/jsx-no-literals': 0,
107
125
  // forbid `javascript:` URLs
@@ -182,6 +200,8 @@ module.exports = {
182
200
  'react/no-unknown-property': 2,
183
201
  // prevent usage of unsafe lifecycle methods
184
202
  'react/no-unsafe': 2,
203
+ // disallow creating unstable components inside components
204
+ 'react/no-unstable-nested-components': 2,
185
205
  // Prevent declaring unused methods of component class
186
206
  'react/no-unused-class-component-methods': 2,
187
207
  // prevent definitions of unused prop types