@adbayb/stack 2.30.0 → 2.32.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.
Files changed (30) hide show
  1. package/configs/eslint/constants.js +31 -6
  2. package/configs/eslint/helpers.js +2 -3
  3. package/configs/eslint/index.js +14 -17
  4. package/configs/eslint/presets/eslint.js +28 -8
  5. package/configs/eslint/presets/import.js +12 -4
  6. package/configs/eslint/presets/jsdoc.js +73 -74
  7. package/configs/eslint/presets/markdown.js +1 -3
  8. package/configs/eslint/presets/node.js +41 -43
  9. package/configs/eslint/presets/prettier.js +1 -0
  10. package/configs/eslint/presets/react.js +98 -61
  11. package/configs/eslint/presets/sonar.js +16 -6
  12. package/configs/eslint/presets/stylistic.js +72 -73
  13. package/configs/eslint/presets/test.js +56 -65
  14. package/configs/eslint/presets/typescript.js +6 -8
  15. package/configs/eslint/presets/uncategorized.js +37 -38
  16. package/configs/eslint/presets/unicorn.js +131 -129
  17. package/dist/index.js +9 -7
  18. package/package.json +21 -21
  19. package/templates/multi-projects/.github/workflows/continuous_delivery.yml +3 -7
  20. package/templates/multi-projects/.github/workflows/conventional_commit.yml +1 -1
  21. package/templates/multi-projects/.github/workflows/dependency_changelog.yml +2 -2
  22. package/templates/multi-projects/.github/workflows/workflow.yml +3 -7
  23. package/templates/multi-projects/package.json.tmpl +1 -1
  24. package/templates/single-project/.github/workflows/continuous_delivery.yml +3 -7
  25. package/templates/single-project/.github/workflows/conventional_commit.yml +1 -1
  26. package/templates/single-project/.github/workflows/dependency_changelog.yml +2 -2
  27. package/templates/single-project/.github/workflows/workflow.yml +3 -7
  28. package/templates/single-project/package.json.tmpl +1 -1
  29. package/configs/eslint/presets/base.js +0 -26
  30. package/configs/eslint/presets/overridable.js +0 -29
@@ -1,10 +1,35 @@
1
- export const CWD = process.cwd();
2
-
3
- export const JAVASCRIPT_EXTENSIONS = ["**/*.{js,jsx,cjs,mjs}"];
1
+ const JAVASCRIPT_EXTENSIONS = ["js", "jsx", "cjs", "mjs", "mjsx"];
2
+ const TYPESCRIPT_EXTENSIONS = ["ts", "tsx", "cts", "mts", "mtsx"];
4
3
 
5
- export const TYPESCRIPT_EXTENSIONS = ["**/*.{ts,tsx,cts,mts}"];
6
-
7
- export const JAVASCRIPT_LIKE_EXTENSIONS = [
4
+ const JAVASCRIPT_LIKE_EXTENSIONS = [
8
5
  ...JAVASCRIPT_EXTENSIONS,
9
6
  ...TYPESCRIPT_EXTENSIONS,
10
7
  ];
8
+
9
+ const JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING =
10
+ JAVASCRIPT_LIKE_EXTENSIONS.join(",");
11
+
12
+ export const JAVASCRIPT_FILES = [`**/*.{${JAVASCRIPT_EXTENSIONS.join(",")}}`];
13
+
14
+ export const JAVASCRIPT_LIKE_FILES = [
15
+ `**/*.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
16
+ ];
17
+
18
+ export const TEST_LIKE_FILES = [
19
+ `**/{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
20
+ `**/*.{test,test-d}.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
21
+ ];
22
+
23
+ export const RELAXED_LIKE_FILES = [
24
+ ...TEST_LIKE_FILES,
25
+ "**/?(.)config?(s)/**",
26
+ "**/examples/**",
27
+ "**/scripts/**",
28
+ "**/tools/**",
29
+ `**/config?(s).{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
30
+ `**/*.config?(s).{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
31
+ `**/stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
32
+ `**/*.stories.{${JAVASCRIPT_LIKE_EXTENSIONS_AS_STRING}}`,
33
+ ];
34
+
35
+ export const CWD = process.cwd();
@@ -1,6 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
- import tseslint from "typescript-eslint";
4
-
5
3
  export const require = createRequire(import.meta.url);
6
- export const createConfig = tseslint.config;
4
+
5
+ export { defineConfig as createConfig } from "eslint/config";
@@ -5,29 +5,26 @@ import { config as testConfig } from "./presets/test.js";
5
5
  import { config as stylisticConfig } from "./presets/stylistic.js";
6
6
  import { config as sonarConfig } from "./presets/sonar.js";
7
7
  import { config as reactConfig } from "./presets/react.js";
8
- import { config as overridableConfig } from "./presets/overridable.js";
8
+ import { prettierConfig } from "./presets/prettier.js";
9
9
  import { config as nodeConfig } from "./presets/node.js";
10
10
  import { config as markdownConfig } from "./presets/markdown.js";
11
11
  import { config as jsdocConfig } from "./presets/jsdoc.js";
12
12
  import { config as importConfig } from "./presets/import.js";
13
13
  import { config as eslintConfig } from "./presets/eslint.js";
14
- import { config as baseConfig } from "./presets/base.js";
15
14
  import { createConfig } from "./helpers.js";
16
15
 
17
16
  export default createConfig(
18
- // The insertion order is important (last same config items overrides previous ones):
19
- ...baseConfig,
20
- ...eslintConfig,
21
- ...typescriptConfig,
22
- ...importConfig,
23
- ...jsdocConfig,
24
- ...markdownConfig,
25
- ...nodeConfig,
26
- ...reactConfig,
27
- ...sonarConfig,
28
- ...stylisticConfig,
29
- ...testConfig,
30
- ...unicornConfig,
31
- ...uncategorizedConfig,
32
- ...overridableConfig,
17
+ eslintConfig,
18
+ typescriptConfig,
19
+ prettierConfig,
20
+ importConfig,
21
+ jsdocConfig,
22
+ markdownConfig,
23
+ nodeConfig,
24
+ reactConfig,
25
+ sonarConfig,
26
+ stylisticConfig,
27
+ testConfig,
28
+ unicornConfig,
29
+ uncategorizedConfig,
33
30
  );
@@ -1,15 +1,35 @@
1
- import {
2
- JAVASCRIPT_EXTENSIONS,
3
- JAVASCRIPT_LIKE_EXTENSIONS,
4
- } from "../constants.js";
1
+ import { resolve } from "node:path";
5
2
 
6
- export const config = [
3
+ import globals from "globals";
4
+ import { includeIgnoreFile } from "@eslint/compat";
5
+
6
+ import { createConfig } from "../helpers.js";
7
+ import { CWD, JAVASCRIPT_FILES, JAVASCRIPT_LIKE_FILES } from "../constants.js";
8
+
9
+ export const config = createConfig(
10
+ {
11
+ languageOptions: {
12
+ ecmaVersion: "latest",
13
+ globals: {
14
+ ...globals.browser,
15
+ ...globals.node,
16
+ ...globals.worker,
17
+ },
18
+ parserOptions: {
19
+ ecmaFeatures: {
20
+ jsx: true,
21
+ },
22
+ },
23
+ sourceType: "module",
24
+ },
25
+ },
26
+ includeIgnoreFile(resolve(CWD, ".gitignore")),
7
27
  {
8
28
  /*
9
29
  * Specific ESLint rules for javascript-only files (as they're already handled for TypeScript files by the transpiler):
10
30
  * This rule list is taken from https://typescript-eslint.io/users/configs/#recommended
11
31
  */
12
- files: JAVASCRIPT_EXTENSIONS,
32
+ files: JAVASCRIPT_FILES,
13
33
  rules: {
14
34
  "constructor-super": "error", // ts(2335) & ts(2377)
15
35
  "getter-return": "error", // ts(2378)
@@ -31,7 +51,7 @@ export const config = [
31
51
  },
32
52
  {
33
53
  // ESLint rules for JavaScript + TypeScript files:
34
- files: JAVASCRIPT_LIKE_EXTENSIONS,
54
+ files: JAVASCRIPT_LIKE_FILES,
35
55
  rules: {
36
56
  "eqeqeq": "error",
37
57
  "for-direction": "error",
@@ -111,4 +131,4 @@ export const config = [
111
131
  "valid-typeof": "error",
112
132
  },
113
133
  },
114
- ];
134
+ );
@@ -1,11 +1,12 @@
1
1
  import importPlugin from "eslint-plugin-import-x";
2
2
 
3
- import { JAVASCRIPT_LIKE_EXTENSIONS } from "../constants.js";
3
+ import { createConfig } from "../helpers.js";
4
+ import { JAVASCRIPT_LIKE_FILES, RELAXED_LIKE_FILES } from "../constants.js";
4
5
 
5
- export const config = [
6
+ export const config = createConfig(
6
7
  importPlugin.flatConfigs.typescript,
7
8
  {
8
- files: JAVASCRIPT_LIKE_EXTENSIONS,
9
+ files: JAVASCRIPT_LIKE_FILES,
9
10
  rules: {
10
11
  "import-x/consistent-type-specifier-style": [
11
12
  "error",
@@ -66,4 +67,11 @@ export const config = [
66
67
  },
67
68
  },
68
69
  },
69
- ];
70
+ {
71
+ files: RELAXED_LIKE_FILES,
72
+ rules: {
73
+ "import-x/no-anonymous-default-export": "off",
74
+ "import-x/no-default-export": "off",
75
+ },
76
+ },
77
+ );
@@ -1,79 +1,78 @@
1
1
  import jsdocPlugin from "eslint-plugin-jsdoc";
2
2
 
3
- import { JAVASCRIPT_LIKE_EXTENSIONS } from "../constants.js";
3
+ import { createConfig } from "../helpers.js";
4
+ import { JAVASCRIPT_LIKE_FILES } from "../constants.js";
4
5
 
5
- export const config = [
6
- {
7
- files: JAVASCRIPT_LIKE_EXTENSIONS,
8
- plugins: {
9
- jsdoc: jsdocPlugin,
10
- },
11
- rules: {
12
- "jsdoc/check-access": "error",
13
- "jsdoc/check-alignment": "error",
14
- "jsdoc/check-examples": "off", // To enable once ESLint >= 8.x is supported
15
- "jsdoc/check-indentation": "error",
16
- "jsdoc/check-line-alignment": "error",
17
- "jsdoc/check-param-names": "error",
18
- "jsdoc/check-property-names": "error",
19
- "jsdoc/check-syntax": "error",
20
- "jsdoc/check-tag-names": "error",
21
- "jsdoc/check-types": "error",
22
- "jsdoc/check-values": "error",
23
- "jsdoc/empty-tags": "error",
24
- "jsdoc/implements-on-classes": "error",
25
- "jsdoc/multiline-blocks": "error",
26
- "jsdoc/no-bad-blocks": "error",
27
- "jsdoc/no-blank-block-descriptions": "error",
28
- "jsdoc/no-blank-blocks": "error",
29
- "jsdoc/no-defaults": "error",
30
- "jsdoc/no-multi-asterisks": "error",
31
- "jsdoc/no-types": "error",
32
- "jsdoc/require-asterisk-prefix": "error",
33
- "jsdoc/require-description": "error",
34
- "jsdoc/require-description-complete-sentence": "error",
35
- "jsdoc/require-example": "error",
36
- "jsdoc/require-hyphen-before-param-description": "error",
37
- "jsdoc/require-jsdoc": [
38
- // To enable once the rule can be configured to require JSDoc for exported functions at package level (only at module level right now)
39
- "off",
40
- {
41
- contexts: [
42
- "TSTypeAliasDeclaration",
43
- "TSInterfaceDeclaration",
44
- "TSMethodSignature",
45
- "TSPropertySignature",
46
- ],
47
- publicOnly: {
48
- ancestorsOnly: true,
49
- cjs: true,
50
- esm: true,
51
- },
52
- require: {
53
- ArrowFunctionExpression: true,
54
- ClassDeclaration: true,
55
- ClassExpression: true,
56
- FunctionDeclaration: true,
57
- FunctionExpression: true,
58
- MethodDefinition: true,
59
- },
6
+ export const config = createConfig({
7
+ files: JAVASCRIPT_LIKE_FILES,
8
+ plugins: {
9
+ jsdoc: jsdocPlugin,
10
+ },
11
+ rules: {
12
+ "jsdoc/check-access": "error",
13
+ "jsdoc/check-alignment": "error",
14
+ "jsdoc/check-examples": "off", // To enable once ESLint >= 8.x is supported
15
+ "jsdoc/check-indentation": "error",
16
+ "jsdoc/check-line-alignment": "error",
17
+ "jsdoc/check-param-names": "error",
18
+ "jsdoc/check-property-names": "error",
19
+ "jsdoc/check-syntax": "error",
20
+ "jsdoc/check-tag-names": "error",
21
+ "jsdoc/check-types": "error",
22
+ "jsdoc/check-values": "error",
23
+ "jsdoc/empty-tags": "error",
24
+ "jsdoc/implements-on-classes": "error",
25
+ "jsdoc/multiline-blocks": "error",
26
+ "jsdoc/no-bad-blocks": "error",
27
+ "jsdoc/no-blank-block-descriptions": "error",
28
+ "jsdoc/no-blank-blocks": "error",
29
+ "jsdoc/no-defaults": "error",
30
+ "jsdoc/no-multi-asterisks": "error",
31
+ "jsdoc/no-types": "error",
32
+ "jsdoc/require-asterisk-prefix": "error",
33
+ "jsdoc/require-description": "error",
34
+ "jsdoc/require-description-complete-sentence": "error",
35
+ "jsdoc/require-example": "error",
36
+ "jsdoc/require-hyphen-before-param-description": "error",
37
+ "jsdoc/require-jsdoc": [
38
+ // To enable once the rule can be configured to require JSDoc for exported functions at package level (only at module level right now)
39
+ "off",
40
+ {
41
+ contexts: [
42
+ "TSTypeAliasDeclaration",
43
+ "TSInterfaceDeclaration",
44
+ "TSMethodSignature",
45
+ "TSPropertySignature",
46
+ ],
47
+ publicOnly: {
48
+ ancestorsOnly: true,
49
+ cjs: true,
50
+ esm: true,
51
+ },
52
+ require: {
53
+ ArrowFunctionExpression: true,
54
+ ClassDeclaration: true,
55
+ ClassExpression: true,
56
+ FunctionDeclaration: true,
57
+ FunctionExpression: true,
58
+ MethodDefinition: true,
60
59
  },
61
- ],
62
- "jsdoc/require-param": "error",
63
- "jsdoc/require-param-description": "error",
64
- "jsdoc/require-param-name": "error",
65
- "jsdoc/require-property": "error",
66
- "jsdoc/require-property-description": "error",
67
- "jsdoc/require-property-name": "error",
68
- "jsdoc/require-returns": "error",
69
- "jsdoc/require-returns-check": "error",
70
- "jsdoc/require-returns-description": "error",
71
- "jsdoc/require-throws": "error",
72
- "jsdoc/require-yields": "error",
73
- "jsdoc/require-yields-check": "error",
74
- "jsdoc/sort-tags": "error",
75
- "jsdoc/tag-lines": "error",
76
- "jsdoc/valid-types": "error",
77
- },
60
+ },
61
+ ],
62
+ "jsdoc/require-param": "error",
63
+ "jsdoc/require-param-description": "error",
64
+ "jsdoc/require-param-name": "error",
65
+ "jsdoc/require-property": "error",
66
+ "jsdoc/require-property-description": "error",
67
+ "jsdoc/require-property-name": "error",
68
+ "jsdoc/require-returns": "error",
69
+ "jsdoc/require-returns-check": "error",
70
+ "jsdoc/require-returns-description": "error",
71
+ "jsdoc/require-throws": "error",
72
+ "jsdoc/require-yields": "error",
73
+ "jsdoc/require-yields-check": "error",
74
+ "jsdoc/sort-tags": "error",
75
+ "jsdoc/tag-lines": "error",
76
+ "jsdoc/valid-types": "error",
78
77
  },
79
- ];
78
+ });
@@ -1,3 +1 @@
1
- import { flat } from "eslint-plugin-mdx";
2
-
3
- export const config = [flat];
1
+ export { flat as config } from "eslint-plugin-mdx";
@@ -2,50 +2,48 @@ import { join } from "node:path";
2
2
 
3
3
  import nodePlugin from "eslint-plugin-n";
4
4
 
5
- import { require } from "../helpers.js";
6
- import { CWD, JAVASCRIPT_LIKE_EXTENSIONS } from "../constants.js";
5
+ import { createConfig, require } from "../helpers.js";
6
+ import { CWD, JAVASCRIPT_LIKE_FILES } from "../constants.js";
7
7
 
8
- export const config = [
9
- {
10
- files: JAVASCRIPT_LIKE_EXTENSIONS,
11
- plugins: {
12
- n: nodePlugin,
13
- },
14
- rules: {
15
- "n/callback-return": "error",
16
- "n/exports-style": ["error", "module.exports"],
17
- "n/hashbang": "error",
18
- "n/no-exports-assign": "error",
19
- "n/no-path-concat": "error",
20
- "n/no-process-env": [
21
- "error",
22
- {
23
- allowedVariables: ["NODE_ENV", "ENVIRONMENT"],
24
- },
25
- ],
26
- "n/no-unpublished-bin": "error",
27
- "n/no-unsupported-features/es-builtins": "error",
28
- "n/no-unsupported-features/es-syntax": "error",
29
- "n/no-unsupported-features/node-builtins": [
30
- "error",
31
- { allowExperimental: true },
32
- ],
33
- "n/prefer-global/buffer": ["error", "always"],
34
- "n/prefer-global/console": ["error", "always"],
35
- "n/prefer-global/process": ["error", "always"],
36
- "n/prefer-global/text-decoder": ["error", "always"],
37
- "n/prefer-global/text-encoder": ["error", "always"],
38
- "n/prefer-global/url": ["error", "always"],
39
- "n/prefer-global/url-search-params": ["error", "always"],
40
- "n/prefer-node-protocol": "error",
41
- "n/prefer-promises/dns": "error",
42
- "n/prefer-promises/fs": "error",
43
- "n/process-exit-as-throw": "error",
44
- },
45
- settings: {
46
- node: {
47
- version: require(join(CWD, "package.json")).engines.node,
8
+ export const config = createConfig({
9
+ files: JAVASCRIPT_LIKE_FILES,
10
+ plugins: {
11
+ n: nodePlugin,
12
+ },
13
+ rules: {
14
+ "n/callback-return": "error",
15
+ "n/exports-style": ["error", "module.exports"],
16
+ "n/hashbang": "error",
17
+ "n/no-exports-assign": "error",
18
+ "n/no-path-concat": "error",
19
+ "n/no-process-env": [
20
+ "error",
21
+ {
22
+ allowedVariables: ["NODE_ENV", "ENVIRONMENT"],
48
23
  },
24
+ ],
25
+ "n/no-unpublished-bin": "error",
26
+ "n/no-unsupported-features/es-builtins": "error",
27
+ "n/no-unsupported-features/es-syntax": "error",
28
+ "n/no-unsupported-features/node-builtins": [
29
+ "error",
30
+ { allowExperimental: true },
31
+ ],
32
+ "n/prefer-global/buffer": ["error", "always"],
33
+ "n/prefer-global/console": ["error", "always"],
34
+ "n/prefer-global/process": ["error", "always"],
35
+ "n/prefer-global/text-decoder": ["error", "always"],
36
+ "n/prefer-global/text-encoder": ["error", "always"],
37
+ "n/prefer-global/url": ["error", "always"],
38
+ "n/prefer-global/url-search-params": ["error", "always"],
39
+ "n/prefer-node-protocol": "error",
40
+ "n/prefer-promises/dns": "error",
41
+ "n/prefer-promises/fs": "error",
42
+ "n/process-exit-as-throw": "error",
43
+ },
44
+ settings: {
45
+ node: {
46
+ version: require(join(CWD, "package.json")).engines.node,
49
47
  },
50
48
  },
51
- ];
49
+ });
@@ -0,0 +1 @@
1
+ export { default as prettierConfig } from "eslint-plugin-prettier/recommended";
@@ -1,74 +1,111 @@
1
1
  import reactHooksPlugin from "eslint-plugin-react-hooks";
2
2
  import reactPlugin from "@eslint-react/eslint-plugin";
3
3
 
4
- import { JAVASCRIPT_LIKE_EXTENSIONS } from "../constants.js";
4
+ import { createConfig } from "../helpers.js";
5
+ import { JAVASCRIPT_FILES, JAVASCRIPT_LIKE_FILES } from "../constants.js";
5
6
 
6
- export const config = [
7
+ const {
8
+ configs: { all: reactPluginConfig },
9
+ } = reactPlugin;
10
+
11
+ export const config = createConfig(
7
12
  {
8
- files: JAVASCRIPT_LIKE_EXTENSIONS,
13
+ files: JAVASCRIPT_LIKE_FILES,
9
14
  plugins: {
10
- "react": reactPlugin,
15
+ ...reactPluginConfig.plugins,
11
16
  "react-hooks": reactHooksPlugin,
12
17
  },
13
18
  rules: {
19
+ "@eslint-react/dom/no-dangerously-set-innerhtml": "error",
20
+ "@eslint-react/dom/no-dangerously-set-innerhtml-with-children":
21
+ "error",
22
+ "@eslint-react/dom/no-find-dom-node": "error",
23
+ "@eslint-react/dom/no-flush-sync": "error",
24
+ "@eslint-react/dom/no-hydrate": "error",
25
+ "@eslint-react/dom/no-missing-button-type": "error",
26
+ "@eslint-react/dom/no-missing-iframe-sandbox": "error",
27
+ "@eslint-react/dom/no-namespace": "error",
28
+ "@eslint-react/dom/no-render": "error",
29
+ "@eslint-react/dom/no-render-return-value": "error",
30
+ "@eslint-react/dom/no-script-url": "error",
31
+ "@eslint-react/dom/no-string-style-prop": "error",
32
+ "@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
33
+ "@eslint-react/dom/no-unsafe-target-blank": "error",
34
+ "@eslint-react/dom/no-use-form-state": "error",
35
+ "@eslint-react/dom/no-void-elements-with-children": "error",
36
+ "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect":
37
+ "error",
38
+ "@eslint-react/jsx-no-comment-textnodes": "error",
39
+ "@eslint-react/jsx-no-iife": "error",
40
+ "@eslint-react/jsx-shorthand-boolean": "error",
41
+ "@eslint-react/jsx-shorthand-fragment": "error",
42
+ "@eslint-react/naming-convention/component-name": "error",
43
+ "@eslint-react/naming-convention/context-name": "error",
44
+ "@eslint-react/naming-convention/use-state": "error",
45
+ "@eslint-react/no-access-state-in-setstate": "error",
46
+ "@eslint-react/no-children-prop": "error",
47
+ "@eslint-react/no-class-component": "error",
48
+ "@eslint-react/no-context-provider": "error",
49
+ "@eslint-react/no-create-ref": "error",
50
+ "@eslint-react/no-default-props": "error",
51
+ "@eslint-react/no-direct-mutation-state": "error",
52
+ "@eslint-react/no-duplicate-key": "error",
53
+ "@eslint-react/no-forbidden-props": "error",
54
+ "@eslint-react/no-forward-ref": "error",
55
+ "@eslint-react/no-implicit-key": "error",
56
+ "@eslint-react/no-leaked-conditional-rendering": "error",
57
+ "@eslint-react/no-missing-component-display-name": "error",
58
+ "@eslint-react/no-missing-key": "error",
59
+ "@eslint-react/no-misused-capture-owner-stack": "error",
60
+ "@eslint-react/no-nested-component-definitions": "error",
61
+ "@eslint-react/no-nested-lazy-component-declarations": "error",
62
+ "@eslint-react/no-prop-types": "error",
63
+ "@eslint-react/no-string-refs": "error",
64
+ "@eslint-react/no-unnecessary-key": "error",
65
+ "@eslint-react/no-unnecessary-use-callback": "error",
66
+ "@eslint-react/no-unnecessary-use-memo": "error",
67
+ "@eslint-react/no-unnecessary-use-prefix": "error",
68
+ "@eslint-react/no-unstable-context-value": "error",
69
+ "@eslint-react/no-unstable-default-props": "error",
70
+ "@eslint-react/no-unused-props": "error",
71
+ "@eslint-react/no-use-context": "error",
72
+ "@eslint-react/no-useless-forward-ref": "error",
73
+ "@eslint-react/no-useless-fragment": "error",
74
+ "@eslint-react/prefer-use-state-lazy-initialization": "error",
75
+ "@eslint-react/web-api/no-leaked-event-listener": "error",
76
+ "@eslint-react/web-api/no-leaked-interval": "error",
77
+ "@eslint-react/web-api/no-leaked-resize-observer": "error",
78
+ "@eslint-react/web-api/no-leaked-timeout": "error",
79
+ "react-hooks/component-hook-factories": "error",
80
+ "react-hooks/config": "error",
81
+ "react-hooks/error-boundaries": "error",
14
82
  "react-hooks/exhaustive-deps": "warn",
83
+ "react-hooks/gating": "error",
84
+ "react-hooks/globals": "error",
85
+ "react-hooks/immutability": "error",
86
+ "react-hooks/incompatible-library": "error",
87
+ "react-hooks/preserve-manual-memoization": "error",
88
+ "react-hooks/purity": "error",
89
+ "react-hooks/refs": "error",
15
90
  "react-hooks/rules-of-hooks": "error",
16
- "react/dom/no-dangerously-set-innerhtml": "error",
17
- "react/dom/no-dangerously-set-innerhtml-with-children": "error",
18
- "react/dom/no-find-dom-node": "error",
19
- "react/dom/no-flush-sync": "error",
20
- "react/dom/no-hydrate": "error",
21
- "react/dom/no-missing-button-type": "error",
22
- "react/dom/no-missing-iframe-sandbox": "error",
23
- "react/dom/no-namespace": "error",
24
- "react/dom/no-render": "error",
25
- "react/dom/no-render-return-value": "error",
26
- "react/dom/no-script-url": "error",
27
- "react/dom/no-unsafe-iframe-sandbox": "error",
28
- "react/dom/no-unsafe-target-blank": "error",
29
- "react/dom/no-use-form-state": "error",
30
- "react/dom/no-void-elements-with-children": "error",
31
- "react/hooks-extra/no-direct-set-state-in-use-effect": "error",
32
- "react/hooks-extra/no-direct-set-state-in-use-layout-effect":
33
- "error",
34
- "react/hooks-extra/no-unnecessary-use-callback": "error",
35
- "react/hooks-extra/no-unnecessary-use-memo": "error",
36
- "react/hooks-extra/no-unnecessary-use-prefix": "error",
37
- "react/hooks-extra/prefer-use-state-lazy-initialization": "error",
38
- "react/jsx-no-iife": "error",
39
- "react/naming-convention/component-name": "error",
40
- "react/naming-convention/context-name": "error",
41
- "react/naming-convention/use-state": "error",
42
- "react/no-access-state-in-setstate": "error",
43
- "react/no-children-prop": "error",
44
- "react/no-class-component": "error",
45
- "react/no-comment-textnodes": "error",
46
- "react/no-context-provider": "error",
47
- "react/no-create-ref": "error",
48
- "react/no-default-props": "error",
49
- "react/no-direct-mutation-state": "error",
50
- "react/no-duplicate-key": "error",
51
- "react/no-forward-ref": "error",
52
- "react/no-implicit-key": "error",
53
- "react/no-leaked-conditional-rendering": "error",
54
- "react/no-missing-component-display-name": "error",
55
- "react/no-missing-key": "error",
56
- "react/no-misused-capture-owner-stack": "error",
57
- "react/no-nested-component-definitions": "error",
58
- "react/no-nested-lazy-component-declarations": "error",
59
- "react/no-prop-types": "error",
60
- "react/no-string-refs": "error",
61
- "react/no-unstable-context-value": "error",
62
- "react/no-unstable-default-props": "error",
63
- "react/no-use-context": "error",
64
- "react/no-useless-forward-ref": "error",
65
- "react/no-useless-fragment": "error",
66
- "react/prefer-shorthand-boolean": "error",
67
- "react/prefer-shorthand-fragment": "error",
68
- "react/web-api/no-leaked-event-listener": "error",
69
- "react/web-api/no-leaked-interval": "error",
70
- "react/web-api/no-leaked-resize-observer": "error",
71
- "react/web-api/no-leaked-timeout": "error",
91
+ "react-hooks/set-state-in-effect": "error",
92
+ "react-hooks/set-state-in-render": "error",
93
+ "react-hooks/static-components": "error",
94
+ "react-hooks/unsupported-syntax": "error",
95
+ "react-hooks/use-memo": "error",
96
+ },
97
+ settings: reactPluginConfig.settings,
98
+ },
99
+ {
100
+ files: JAVASCRIPT_FILES,
101
+ rules: {
102
+ /*
103
+ * Disable type-checked-related rules for JavaScript files to prevent unconfigured TypeScript parser errors.
104
+ * Until the React X plugin provides a `disableTypeChecked`-like preset, we must maintain the rule list manually
105
+ * following the [documentation](https://eslint-react.xyz/docs/configuration/configure-project-config#type-information).
106
+ */
107
+ "@eslint-react/no-leaked-conditional-rendering": "off",
108
+ "@eslint-react/no-unused-props": "off",
72
109
  },
73
110
  },
74
- ];
111
+ );