@open-xchange/linter-presets 1.14.0 → 1.15.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 +10 -0
- package/dist/eslint/env/react.d.ts +0 -29
- package/dist/eslint/env/react.js +0 -16
- package/docs/eslint/env/react.md +0 -3
- package/package.json +13 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## `1.15.0` – 2025-Oct-24
|
|
4
|
+
|
|
5
|
+
- removed: (ESLint) plugin `eslint-plugin-react-hooks-static-deps`
|
|
6
|
+
- removed: (ESLint) options `additionalHooks` and `staticHooks` in `env.react`
|
|
7
|
+
- added: (ESLint) reactivated rule `react-hooks/exhaustive-deps` in `env.react`
|
|
8
|
+
|
|
9
|
+
## `1.14.1` – 2025-Oct-23
|
|
10
|
+
|
|
11
|
+
- chore: bump dependencies
|
|
12
|
+
|
|
3
13
|
## `1.14.0` – 2025-Oct-16
|
|
4
14
|
|
|
5
15
|
- added: (ESLint) plugin `eslint-plugin-no-unsanitized` for `env.browser`
|
|
@@ -9,34 +9,6 @@ export interface EnvReactOptions extends EnvBaseOptions {
|
|
|
9
9
|
* Additional hooks that will be treated as effect hooks, like "useEffect".
|
|
10
10
|
*/
|
|
11
11
|
effectHooks?: readonly string[];
|
|
12
|
-
/**
|
|
13
|
-
* Configuration for the rule "react-hooks-static-deps/exhaustive-deps".
|
|
14
|
-
*
|
|
15
|
-
* Additional hooks that will be checked for dependencies, as a dictionary
|
|
16
|
-
* mapping hook names to the parameter index of the callback function to be
|
|
17
|
-
* analyzed.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* additionalHooks: {
|
|
21
|
-
* useCustomHook: 0, // usage: `useCustomHook(callback, [deps])`
|
|
22
|
-
* useOtherHook: 1, // usage: `useOtherHook(value, callback, [deps])`
|
|
23
|
-
* }
|
|
24
|
-
*/
|
|
25
|
-
additionalHooks?: Record<string, number>;
|
|
26
|
-
/**
|
|
27
|
-
* Configuration for the rule "react-hooks-static-deps/exhaustive-deps".
|
|
28
|
-
*
|
|
29
|
-
* Additional hooks that return stable values, as a dictionary mapping hook
|
|
30
|
-
* names to the declaration of the stable values the hook will return.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* staticHooks: {
|
|
34
|
-
* useCustomHook: true, // entire return value is stable
|
|
35
|
-
* useOtherHook: [false, true], // second array element is stable
|
|
36
|
-
* useThirdHook: { callback: true }, // property "callback" is stable
|
|
37
|
-
* }
|
|
38
|
-
*/
|
|
39
|
-
staticHooks?: Record<string, boolean | boolean[] | Record<string, boolean>>;
|
|
40
12
|
}
|
|
41
13
|
/**
|
|
42
14
|
* Creates configuration objects with linter rules for ReactJS.
|
|
@@ -44,7 +16,6 @@ export interface EnvReactOptions extends EnvBaseOptions {
|
|
|
44
16
|
* Wraps the following packages:
|
|
45
17
|
* - `@eslint-react/eslint-plugin`
|
|
46
18
|
* - `eslint-plugin-react-hooks`
|
|
47
|
-
* - `eslint-plugin-react-hooks-static-deps`
|
|
48
19
|
* - `eslint-plugin-react-refresh`
|
|
49
20
|
* - `eslint-plugin-jsx-a11y`
|
|
50
21
|
*
|
package/dist/eslint/env/react.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import reactPlugin from "@eslint-react/eslint-plugin";
|
|
2
2
|
import reactHooksPluginModule from "eslint-plugin-react-hooks";
|
|
3
|
-
import reactHooksStaticDepsPlugin from "eslint-plugin-react-hooks-static-deps";
|
|
4
3
|
import reactRefreshPlugin from "eslint-plugin-react-refresh";
|
|
5
4
|
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
|
|
6
|
-
import { fixupPluginRules } from "@eslint/compat";
|
|
7
5
|
import { parser } from "typescript-eslint";
|
|
8
6
|
import { createConfig, customRules, convertRuleWarningsToErrors } from "../shared/env-utils.js";
|
|
9
7
|
// workaround for broken typings
|
|
@@ -15,7 +13,6 @@ const reactHooksPlugin = reactHooksPluginModule;
|
|
|
15
13
|
* Wraps the following packages:
|
|
16
14
|
* - `@eslint-react/eslint-plugin`
|
|
17
15
|
* - `eslint-plugin-react-hooks`
|
|
18
|
-
* - `eslint-plugin-react-hooks-static-deps`
|
|
19
16
|
* - `eslint-plugin-react-refresh`
|
|
20
17
|
* - `eslint-plugin-jsx-a11y`
|
|
21
18
|
*
|
|
@@ -63,19 +60,6 @@ export default function react(envOptions) {
|
|
|
63
60
|
}),
|
|
64
61
|
// "react-hooks" plugin and recommended rules, raise all recommended rules to "error" level
|
|
65
62
|
createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended)),
|
|
66
|
-
// "react-hooks-static-deps" plugin
|
|
67
|
-
(envOptions.additionalHooks ?? envOptions.staticHooks) && createConfig("env.react.static-deps", envOptions, {
|
|
68
|
-
plugins: {
|
|
69
|
-
"react-hooks-static-deps": fixupPluginRules(reactHooksStaticDepsPlugin), // https://github.com/stoikio/eslint-plugin-react-hooks-static-deps/issues/1
|
|
70
|
-
},
|
|
71
|
-
rules: {
|
|
72
|
-
"react-hooks/exhaustive-deps": "off",
|
|
73
|
-
"react-hooks-static-deps/exhaustive-deps": ["error", {
|
|
74
|
-
additionalHooks: envOptions.additionalHooks,
|
|
75
|
-
staticHooks: envOptions.staticHooks,
|
|
76
|
-
}],
|
|
77
|
-
},
|
|
78
|
-
}),
|
|
79
63
|
// "react-refresh" plugin
|
|
80
64
|
createConfig("env.react.react-refresh", envOptions, reactRefreshPlugin.configs.vite),
|
|
81
65
|
// "jsx-a11y" plugin
|
package/docs/eslint/env/react.md
CHANGED
|
@@ -4,7 +4,6 @@ Creates configuration objects with linter rules for ReactJS. Adds the following
|
|
|
4
4
|
|
|
5
5
|
- [@eslint-react/eslint-plugin](https://eslint-react.xyz/)
|
|
6
6
|
- [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
|
|
7
|
-
- [eslint-plugin-react-hooks-static-deps](https://github.com/stoikio/eslint-plugin-react-hooks-static-deps)
|
|
8
7
|
- [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh)
|
|
9
8
|
- [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
|
|
10
9
|
|
|
@@ -23,8 +22,6 @@ function react(options: EnvReactOptions): Linter.Config[];
|
|
|
23
22
|
| `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
|
|
24
23
|
| `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
|
|
25
24
|
| `effectHooks` | `string[]` | `[]` | Additional hooks that will be treated as effect hooks, like "useEffect". |
|
|
26
|
-
| `additionalHooks` | `Record<string,number>` | `{}` | Additional hooks that will be checked for dependencies. |
|
|
27
|
-
| `staticHooks` | `Record<string,boolean\|boolean[]\|Record<string,boolean>>` | `{}` | Additional hooks that return stable values. |
|
|
28
25
|
|
|
29
26
|
## Example
|
|
30
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/linter-presets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Configuration presets for ESLint and StyleLint",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"@babel/eslint-parser": "^7.28.4",
|
|
35
35
|
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
36
36
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
37
|
-
"@eslint-react/eslint-plugin": "^2.2.
|
|
37
|
+
"@eslint-react/eslint-plugin": "^2.2.3",
|
|
38
38
|
"@eslint/compat": "^1.4.0",
|
|
39
|
-
"@eslint/config-helpers": "^0.4.
|
|
40
|
-
"@eslint/js": "^9.
|
|
41
|
-
"@eslint/markdown": "^7.
|
|
42
|
-
"@stylistic/eslint-plugin": "^5.
|
|
39
|
+
"@eslint/config-helpers": "^0.4.1",
|
|
40
|
+
"@eslint/js": "^9.38.0",
|
|
41
|
+
"@eslint/markdown": "^7.5.0",
|
|
42
|
+
"@stylistic/eslint-plugin": "^5.5.0",
|
|
43
43
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
44
44
|
"@stylistic/stylelint-config": "^3.0.1",
|
|
45
45
|
"@stylistic/stylelint-plugin": "^4.0.0",
|
|
46
46
|
"@types/picomatch": "^4.0.2",
|
|
47
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
47
|
+
"@vitest/eslint-plugin": "^1.3.23",
|
|
48
48
|
"confusing-browser-globals": "^1.0.11",
|
|
49
49
|
"empathic": "^2.0.0",
|
|
50
50
|
"eslint-plugin-chai-expect": "^3.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"eslint-plugin-jest": "^29.0.1",
|
|
55
55
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
56
56
|
"eslint-plugin-jest-extended": "^3.0.1",
|
|
57
|
-
"eslint-plugin-jsdoc": "^61.1.
|
|
57
|
+
"eslint-plugin-jsdoc": "^61.1.5",
|
|
58
58
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
59
59
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
60
60
|
"eslint-plugin-license-header": "^0.8.0",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"eslint-plugin-no-unsanitized": "^4.1.4",
|
|
63
63
|
"eslint-plugin-promise": "^7.2.1",
|
|
64
64
|
"eslint-plugin-react-hooks": "^7.0.0",
|
|
65
|
-
"eslint-plugin-react-hooks-static-deps": "^1.0.7",
|
|
66
65
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
67
66
|
"eslint-plugin-regexp": "^2.10.0",
|
|
68
67
|
"eslint-plugin-testing-library": "^7.13.3",
|
|
@@ -76,16 +75,16 @@
|
|
|
76
75
|
"stylelint-config-standard-scss": "^16.0.0",
|
|
77
76
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
78
77
|
"stylelint-plugin-license-header": "^1.0.3",
|
|
79
|
-
"typescript-eslint": "^8.46.
|
|
78
|
+
"typescript-eslint": "^8.46.2",
|
|
80
79
|
"vue-eslint-parser": "^10.2.0"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
82
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
84
83
|
"@types/eslint-scope": "^8.3.2",
|
|
85
|
-
"@types/node": "^24.
|
|
84
|
+
"@types/node": "^24.9.1",
|
|
86
85
|
"@types/react": "^19.2.2",
|
|
87
|
-
"@typescript-eslint/utils": "^8.46.
|
|
88
|
-
"eslint": "^9.
|
|
86
|
+
"@typescript-eslint/utils": "^8.46.2",
|
|
87
|
+
"eslint": "^9.38.0",
|
|
89
88
|
"jest": "^30.2.0",
|
|
90
89
|
"jiti": "^2.6.1",
|
|
91
90
|
"premove": "^4.0.0",
|
|
@@ -100,7 +99,7 @@
|
|
|
100
99
|
"postcss": "^8.4.0",
|
|
101
100
|
"stylelint": "^16.23.0",
|
|
102
101
|
"typescript": "^5.9.0",
|
|
103
|
-
"vitest": "^
|
|
102
|
+
"vitest": "^3.0.0 || ^4.0.0"
|
|
104
103
|
},
|
|
105
104
|
"peerDependenciesMeta": {
|
|
106
105
|
"eslint": {
|