@open-xchange/linter-presets 1.9.6 → 1.11.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 CHANGED
@@ -1,12 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.11.0` – 2025-Oct-03
4
+
5
+ - added: (ESLint) new option "effectHooks" for `env.react`
6
+
7
+ ## `1.10.0` – 2025-Oct-02
8
+
9
+ - chore: (ESLint) bump `@eslint-react/eslint-plugin` to v2
10
+ - added: (ESLint) rules `jsdoc/escape-inline-tags`, `jsdoc/require-template-description`
11
+ - chore: bump dependencies
12
+ - chore: (ESLint) raised peer dependency requirements for `eslint` (9.35.0) and `typescript` (5.9.0)
13
+
3
14
  ## `1.9.6` – 2025-Sep-25
4
15
 
5
16
  - chore: bump dependencies
6
17
 
7
18
  ## `1.9.5` – 2025-Sep-22
8
19
 
9
- - chore: bump `eslint-plugin-jsdoc` to v60.1.1 (fix for <https://github.com/gajus/eslint-plugin-jsdoc/issues/1538>)
20
+ - chore: (ESLint) bump `eslint-plugin-jsdoc` to v60.1.1 (fix for <https://github.com/gajus/eslint-plugin-jsdoc/issues/1538>)
10
21
 
11
22
  ## `1.9.4` – 2025-Sep-18
12
23
 
@@ -28,7 +39,7 @@
28
39
 
29
40
  ## `1.9.0` – 2025-Sep-09
30
41
 
31
- - chore: bump `eslint-plugin-jsdoc` to v55.0.3
42
+ - chore: (ESLint) bump `eslint-plugin-jsdoc` to v55.0.3
32
43
  - chore: bump dependencies
33
44
 
34
45
  ## `1.8.1` – 2025-Sep-04
@@ -60,9 +60,12 @@ export default function jsdoc() {
60
60
  files: SRC_GLOB,
61
61
  rules: {
62
62
  "jsdoc/check-template-names": "error",
63
+ "jsdoc/escape-inline-tags": "error",
63
64
  "jsdoc/require-asterisk-prefix": "error",
64
65
  "jsdoc/require-jsdoc": ["error", { contexts: ["ClassDeclaration", "TSInterfaceDeclaration"] }],
66
+ "jsdoc/require-returns-check": ["error", { exemptAsync: false }],
65
67
  "jsdoc/require-template": ["error", { requireSeparateTemplates: true }],
68
+ "jsdoc/require-template-description": "error",
66
69
  "jsdoc/require-throws": "error",
67
70
  "jsdoc/require-throws-description": "error",
68
71
  "jsdoc/require-yields-description": "error",
@@ -3,6 +3,12 @@ import type { ConfigWithExtendsArg, EnvBaseOptions } from "../shared/env-utils.j
3
3
  * Configuration options for the environment preset "env.react".
4
4
  */
5
5
  export interface EnvReactOptions extends EnvBaseOptions {
6
+ /**
7
+ * Configuration for the rule "react-hooks/rules-of-hooks".
8
+ *
9
+ * Additional hooks that will be treated as effect hooks, like "useEffect".
10
+ */
11
+ effectHooks?: readonly string[];
6
12
  /**
7
13
  * Configuration for the rule "react-hooks-static-deps/exhaustive-deps".
8
14
  *
@@ -33,30 +33,37 @@ export default function react(envOptions) {
33
33
  parserOptions: { projectService: true },
34
34
  },
35
35
  // register rule implementations and language settings, raise all recommended rules to "error" level
36
- ...convertRuleWarningsToErrors(reactPlugin.configs["recommended-typescript"]),
36
+ ...convertRuleWarningsToErrors(reactPlugin.configs["recommended-type-checked"]),
37
+ // additional settings
38
+ settings: {
39
+ ...reactPlugin.configs["recommended-type-checked"].settings,
40
+ ...(envOptions.effectHooks?.length ? {
41
+ "react-hooks": {
42
+ additionalEffectHooks: `^(${envOptions.effectHooks.join("|")})$`,
43
+ },
44
+ } : undefined),
45
+ },
37
46
  }, {
38
47
  // custom overrides
39
48
  "@eslint-react/jsx-no-iife": "error",
49
+ "@eslint-react/jsx-no-duplicate-props": "error",
40
50
  "@eslint-react/jsx-no-undef": "error",
51
+ "@eslint-react/jsx-shorthand-boolean": "error",
52
+ "@eslint-react/jsx-shorthand-fragment": "error",
53
+ "@eslint-react/jsx-uses-vars": "error",
41
54
  "@eslint-react/no-children-prop": "error",
42
55
  "@eslint-react/no-class-component": "error",
43
- "@eslint-react/no-duplicate-jsx-props": "error",
44
- "@eslint-react/no-implicit-key": "error",
45
56
  "@eslint-react/no-missing-component-display-name": "error",
57
+ "@eslint-react/no-unnecessary-use-callback": "error",
58
+ "@eslint-react/no-unnecessary-use-memo": "error",
46
59
  "@eslint-react/no-useless-fragment": "error",
60
+ "@eslint-react/prefer-namespace-import": "error",
47
61
  "@eslint-react/prefer-read-only-props": "error",
48
- "@eslint-react/prefer-shorthand-boolean": "error",
49
- "@eslint-react/prefer-shorthand-fragment": "error",
50
- "@eslint-react/use-jsx-vars": "error",
51
- "@eslint-react/dom/no-flush-sync": "error",
52
62
  "@eslint-react/dom/no-unknown-property": "error",
53
- "@eslint-react/hooks-extra/no-unnecessary-use-callback": "error",
54
- "@eslint-react/hooks-extra/no-unnecessary-use-memo": "error",
55
63
  "@eslint-react/naming-convention/filename-extension": ["error", { allow: "as-needed" }],
56
- "@eslint-react/naming-convention/use-state": "error",
57
64
  }),
58
65
  // "react-hooks" plugin and recommended rules, raise all recommended rules to "error" level
59
- createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs["recommended-latest"])),
66
+ createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs["flat/recommended"][0])),
60
67
  // "react-hooks-static-deps" plugin
61
68
  (envOptions.additionalHooks ?? envOptions.staticHooks) && createConfig("env.react.static-deps", envOptions, {
62
69
  plugins: {
@@ -1,6 +1,7 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
2
  // exports ====================================================================
3
3
  export default ESLintUtils.RuleCreator.withoutDocs({
4
+ name: "no-amd-module-directive",
4
5
  meta: {
5
6
  type: "problem",
6
7
  schema: [],
@@ -2,6 +2,7 @@ import { AST_NODE_TYPES as NodeType, ESLintUtils } from "@typescript-eslint/util
2
2
  import { Schema, makeArray, ProjectContext } from "../shared/rule-utils.js";
3
3
  // exports ====================================================================
4
4
  export default ESLintUtils.RuleCreator.withoutDocs({
5
+ name: "no-invalid-hierarchy",
5
6
  meta: {
6
7
  type: "problem",
7
8
  schema: [
@@ -2,6 +2,7 @@ import { AST_NODE_TYPES as NodeType, ESLintUtils } from "@typescript-eslint/util
2
2
  import { Schema, ProjectContext } from "../shared/rule-utils.js";
3
3
  // exports ====================================================================
4
4
  export default ESLintUtils.RuleCreator.withoutDocs({
5
+ name: "no-invalid-modules",
5
6
  meta: {
6
7
  type: "problem",
7
8
  schema: [
@@ -22,6 +22,9 @@ function react(options: EnvReactOptions): Linter.Config[];
22
22
  | `files` | `Array<string\|string[]>` | _required_ | Glob patterns for source files to be included. Use embedded arrays for AND patterns. |
23
23
  | `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
24
24
  | `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
25
+ | `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. |
25
28
 
26
29
  ## Example
27
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.9.6",
3
+ "version": "1.11.0",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,7 @@
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": "^1.53.1",
37
+ "@eslint-react/eslint-plugin": "^2.0.5",
38
38
  "@eslint/compat": "^1.4.0",
39
39
  "@eslint/config-helpers": "^0.4.0",
40
40
  "@eslint/js": "^9.36.0",
@@ -44,7 +44,7 @@
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.12",
47
+ "@vitest/eslint-plugin": "^1.3.13",
48
48
  "confusing-browser-globals": "^1.0.11",
49
49
  "empathic": "^2.0.0",
50
50
  "eslint-plugin-chai-expect": "^3.1.0",
@@ -54,17 +54,17 @@
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": "^60.3.0",
57
+ "eslint-plugin-jsdoc": "^60.7.0",
58
58
  "eslint-plugin-jsonc": "^2.20.1",
59
59
  "eslint-plugin-jsx-a11y": "^6.10.2",
60
60
  "eslint-plugin-license-header": "^0.8.0",
61
61
  "eslint-plugin-n": "^17.23.1",
62
62
  "eslint-plugin-promise": "^7.2.1",
63
- "eslint-plugin-react-hooks": "^5.2.0",
63
+ "eslint-plugin-react-hooks": "^6.1.0",
64
64
  "eslint-plugin-react-hooks-static-deps": "^1.0.7",
65
- "eslint-plugin-react-refresh": "^0.4.21",
65
+ "eslint-plugin-react-refresh": "^0.4.23",
66
66
  "eslint-plugin-regexp": "^2.10.0",
67
- "eslint-plugin-testing-library": "^7.9.2",
67
+ "eslint-plugin-testing-library": "^7.11.0",
68
68
  "eslint-plugin-vue": "^10.5.0",
69
69
  "eslint-plugin-yml": "^1.18.0",
70
70
  "globals": "^16.4.0",
@@ -75,30 +75,30 @@
75
75
  "stylelint-config-standard-scss": "^16.0.0",
76
76
  "stylelint-config-standard-vue": "^1.0.0",
77
77
  "stylelint-plugin-license-header": "^1.0.3",
78
- "typescript-eslint": "^8.44.1",
78
+ "typescript-eslint": "^8.45.0",
79
79
  "vue-eslint-parser": "^10.2.0"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@types/confusing-browser-globals": "^1.0.3",
83
83
  "@types/eslint-scope": "^8.3.2",
84
- "@types/node": "^24.5.2",
85
- "@types/react": "^19.1.13",
86
- "@typescript-eslint/utils": "^8.44.1",
84
+ "@types/node": "^24.6.2",
85
+ "@types/react": "^19.2.0",
86
+ "@typescript-eslint/utils": "^8.45.0",
87
87
  "eslint": "^9.36.0",
88
- "jest": "^30.1.3",
89
- "jiti": "^2.6.0",
88
+ "jest": "^30.2.0",
89
+ "jiti": "^2.6.1",
90
90
  "premove": "^4.0.0",
91
91
  "stylelint": "^16.24.0",
92
92
  "ts-patch": "^3.3.0",
93
- "typescript": "^5.9.2",
93
+ "typescript": "^5.9.3",
94
94
  "typescript-transform-paths": "^3.5.5"
95
95
  },
96
96
  "peerDependencies": {
97
- "eslint": "^9.30.0",
97
+ "eslint": "^9.35.0",
98
98
  "jest": "^29.7.0 || ^30.0.0",
99
99
  "postcss": "^8.4.0",
100
100
  "stylelint": "^16.23.0",
101
- "typescript": "^5.7.0",
101
+ "typescript": "^5.9.0",
102
102
  "vitest": "^2.0.0 || ^3.0.0"
103
103
  },
104
104
  "peerDependenciesMeta": {