@open-xchange/linter-presets 1.11.1 → 1.13.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,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.13.0` – 2025-Oct-16
4
+
5
+ - chore: bump dependencies
6
+ - changed: (ESLint) `@eslint-react/eslint-plugin`: switch to "strict-type-checked" preset
7
+ - added: (ESLint) rule `jsdoc/ts-no-unnecessary-template-expression`
8
+
9
+ ## `1.12.0` – 2025-Oct-09
10
+
11
+ - chore: bump dependencies
12
+ - chore: (ESLint) bump `eslint-plugin-react-hooks` to v7
13
+
3
14
  ## `1.11.1` – 2025-Oct-06
4
15
 
5
16
  - changed: (ESLint) JSDoc: do not check `@returns` in async void functions
@@ -69,6 +69,7 @@ export default function jsdoc() {
69
69
  "jsdoc/require-throws-description": "error",
70
70
  "jsdoc/require-yields-description": "error",
71
71
  "jsdoc/tag-lines": "off",
72
+ "jsdoc/ts-no-unnecessary-template-expression": "error",
72
73
  },
73
74
  },
74
75
  ];
@@ -1,11 +1,13 @@
1
1
  import reactPlugin from "@eslint-react/eslint-plugin";
2
- import reactHooksPlugin from "eslint-plugin-react-hooks";
2
+ import reactHooksPluginModule from "eslint-plugin-react-hooks";
3
3
  import reactHooksStaticDepsPlugin from "eslint-plugin-react-hooks-static-deps";
4
4
  import reactRefreshPlugin from "eslint-plugin-react-refresh";
5
5
  import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
6
6
  import { fixupPluginRules } from "@eslint/compat";
7
7
  import { parser } from "typescript-eslint";
8
8
  import { createConfig, customRules, convertRuleWarningsToErrors } from "../shared/env-utils.js";
9
+ // workaround for broken typings
10
+ const reactHooksPlugin = reactHooksPluginModule;
9
11
  // functions ==================================================================
10
12
  /**
11
13
  * Creates configuration objects with linter rules for ReactJS.
@@ -24,6 +26,7 @@ import { createConfig, customRules, convertRuleWarningsToErrors } from "../share
24
26
  * The configuration entries to be added to the resulting configuration array.
25
27
  */
26
28
  export default function react(envOptions) {
29
+ const reactConfig = reactPlugin.configs["strict-type-checked"];
27
30
  return [
28
31
  // configure "react" plugin for all source files (JSX and TSX)
29
32
  createConfig("env.react.recommended", envOptions, {
@@ -33,10 +36,10 @@ export default function react(envOptions) {
33
36
  parserOptions: { projectService: true },
34
37
  },
35
38
  // register rule implementations and language settings, raise all recommended rules to "error" level
36
- ...convertRuleWarningsToErrors(reactPlugin.configs["recommended-type-checked"]),
39
+ ...convertRuleWarningsToErrors(reactConfig),
37
40
  // additional settings
38
41
  settings: {
39
- ...reactPlugin.configs["recommended-type-checked"].settings,
42
+ ...reactConfig.settings,
40
43
  ...(envOptions.effectHooks?.length ? {
41
44
  "react-hooks": {
42
45
  additionalEffectHooks: `^(${envOptions.effectHooks.join("|")})$`,
@@ -46,24 +49,20 @@ export default function react(envOptions) {
46
49
  }, {
47
50
  // custom overrides
48
51
  "@eslint-react/jsx-no-iife": "error",
49
- "@eslint-react/jsx-no-duplicate-props": "error",
50
52
  "@eslint-react/jsx-no-undef": "error",
51
53
  "@eslint-react/jsx-shorthand-boolean": "error",
52
54
  "@eslint-react/jsx-shorthand-fragment": "error",
53
- "@eslint-react/jsx-uses-vars": "error",
54
- "@eslint-react/no-children-prop": "error",
55
- "@eslint-react/no-class-component": "error",
56
55
  "@eslint-react/no-missing-component-display-name": "error",
57
- "@eslint-react/no-unnecessary-use-callback": "error",
58
- "@eslint-react/no-unnecessary-use-memo": "error",
59
- "@eslint-react/no-useless-fragment": "error",
56
+ "@eslint-react/no-missing-context-display-name": "error",
60
57
  "@eslint-react/prefer-namespace-import": "error",
61
58
  "@eslint-react/prefer-read-only-props": "error",
62
59
  "@eslint-react/dom/no-unknown-property": "error",
60
+ "@eslint-react/naming-convention/component-name": "error",
61
+ "@eslint-react/naming-convention/context-name": "error",
63
62
  "@eslint-react/naming-convention/filename-extension": ["error", { allow: "as-needed" }],
64
63
  }),
65
64
  // "react-hooks" plugin and recommended rules, raise all recommended rules to "error" level
66
- createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs["flat/recommended"][0])),
65
+ createConfig("env.react.react-hooks", envOptions, convertRuleWarningsToErrors(reactHooksPlugin.configs.flat.recommended)),
67
66
  // "react-hooks-static-deps" plugin
68
67
  (envOptions.additionalHooks ?? envOptions.staticHooks) && createConfig("env.react.static-deps", envOptions, {
69
68
  plugins: {
@@ -1,7 +1,6 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
2
  // exports ====================================================================
3
3
  export default ESLintUtils.RuleCreator.withoutDocs({
4
- name: "no-amd-module-directive",
5
4
  meta: {
6
5
  type: "problem",
7
6
  schema: [],
@@ -2,7 +2,6 @@ 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",
6
5
  meta: {
7
6
  type: "problem",
8
7
  schema: [
@@ -2,7 +2,6 @@ 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",
6
5
  meta: {
7
6
  type: "problem",
8
7
  schema: [
@@ -23,17 +23,17 @@ function browser(options: EnvBrowserOptions): Linter.Config[];
23
23
  - Type: `EnvRestrictedOptions`
24
24
  - Default: `{}`
25
25
 
26
- This option allows to specify banned globals, imports, object properties, and syntax constructs. These restricted items will be set on top of the built-in restricted items of the environment preset, and will be passed to the ESLint core rules [`no-restricted-globals`](https://eslint.org/docs/latest/rules/no-restricted-globals), [`no-restricted-imports`](https://eslint.org/docs/latest/rules/no-restricted-imports), [`no-restricted-properties`](https://eslint.org/docs/latest/rules/no-restricted-properties), and [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax), respectively.
26
+ This option allows to specify banned globals, imports, object properties, and syntax constructs. These restricted items will be set on top of the built-in restricted items of the environment preset, and will be passed to the respective ESLint core rules (see table below).
27
27
 
28
28
  The option `restricted` is an object with the following properties:
29
29
 
30
- | Name | Type | Default | Description |
31
- | - | - | - | - |
32
- | `globals` | `EnvRestrictedName[]` | `[]` | Banned global symbols. Each entry is an object with string properties `name` and `message`. |
33
- | `imports` | `EnvRestrictedName[]` | `[]` | Banned modules that must not be imported. Each entry is an object with string properties `name` and `message`. |
34
- | `properties` | `EnvRestrictedProperty[]` | `[]` | Banned object properties. Each entry is an object with string properties `object`, `property`, and `message`). |
35
- | `syntax` | `EnvRestrictedSyntax[]` | `[]` | Banned syntax constructs by [AST selectors](https://eslint.org/docs/latest/extend/selectors). Each entry is an object with string properties `selector` and `message`. |
36
- | `overrides` | `EnvRestrictedOverride[]` | `[]` | Overrides for specific subsets of files in the environment. Each entry is an object with the common properties `files` (required) and `ignores`, and the properties `globals`, `imports`, `properties`, and `syntax` to specify restricted items (see above). All restricted items of overrides will be merged with the common restricted items defined for the entire environment. |
30
+ | Name | Type | Default | Description | ESLint Rules |
31
+ | - | - | - | - | - |
32
+ | `globals` | `EnvRestrictedName[]` | `[]` | Banned global symbols. Each entry is an object with string properties `name` and `message`. | [`no-restricted-globals`](https://eslint.org/docs/latest/rules/no-restricted-globals) |
33
+ | `imports` | `EnvRestrictedName[]` | `[]` | Banned modules that must not be imported. Each entry is an object with string properties `name` and `message`. | [`no-restricted-imports`](https://eslint.org/docs/latest/rules/no-restricted-imports), [`no-restricted-modules`](https://eslint.org/docs/latest/rules/no-restricted-modules) |
34
+ | `properties` | `EnvRestrictedProperty[]` | `[]` | Banned object properties. Each entry is an object with string properties `object`, `property`, and `message`). | [`no-restricted-properties`](https://eslint.org/docs/latest/rules/no-restricted-properties) |
35
+ | `syntax` | `EnvRestrictedSyntax[]` | `[]` | Banned syntax constructs by [AST selectors](https://eslint.org/docs/latest/extend/selectors). Each entry is an object with string properties `selector` and `message`. | [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax) |
36
+ | `overrides` | `EnvRestrictedOverride[]` | `[]` | Overrides for specific subsets of files in the environment. Each entry is an object with the common properties `files` (required) and `ignores`, and the properties `globals`, `imports`, `properties`, and `syntax` to specify restricted items (see above). All restricted items of overrides will be merged with the common restricted items defined for the entire environment. | |
37
37
 
38
38
  The environment `env.browser` already defines the following built-in restrictions:
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.11.1",
3
+ "version": "1.13.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.0.5",
37
+ "@eslint-react/eslint-plugin": "^2.2.2",
38
38
  "@eslint/compat": "^1.4.0",
39
39
  "@eslint/config-helpers": "^0.4.0",
40
- "@eslint/js": "^9.36.0",
41
- "@eslint/markdown": "^7.3.0",
40
+ "@eslint/js": "^9.37.0",
41
+ "@eslint/markdown": "^7.4.0",
42
42
  "@stylistic/eslint-plugin": "^5.4.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.13",
47
+ "@vitest/eslint-plugin": "^1.3.20",
48
48
  "confusing-browser-globals": "^1.0.11",
49
49
  "empathic": "^2.0.0",
50
50
  "eslint-plugin-chai-expect": "^3.1.0",
@@ -54,41 +54,41 @@
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.7.0",
58
- "eslint-plugin-jsonc": "^2.20.1",
57
+ "eslint-plugin-jsdoc": "^61.1.4",
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",
61
61
  "eslint-plugin-n": "^17.23.1",
62
62
  "eslint-plugin-promise": "^7.2.1",
63
- "eslint-plugin-react-hooks": "^6.1.0",
63
+ "eslint-plugin-react-hooks": "^7.0.0",
64
64
  "eslint-plugin-react-hooks-static-deps": "^1.0.7",
65
- "eslint-plugin-react-refresh": "^0.4.23",
65
+ "eslint-plugin-react-refresh": "^0.4.24",
66
66
  "eslint-plugin-regexp": "^2.10.0",
67
- "eslint-plugin-testing-library": "^7.11.0",
68
- "eslint-plugin-vue": "^10.5.0",
69
- "eslint-plugin-yml": "^1.18.0",
67
+ "eslint-plugin-testing-library": "^7.13.3",
68
+ "eslint-plugin-vue": "^10.5.1",
69
+ "eslint-plugin-yml": "^1.19.0",
70
70
  "globals": "^16.4.0",
71
71
  "picomatch": "^4.0.3",
72
72
  "postcss-html": "^1.8.0",
73
- "stylelint-config-standard": "^39.0.0",
73
+ "stylelint-config-standard": "^39.0.1",
74
74
  "stylelint-config-standard-less": "^3.0.1",
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.45.0",
78
+ "typescript-eslint": "^8.46.1",
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.6.2",
85
- "@types/react": "^19.2.0",
86
- "@typescript-eslint/utils": "^8.45.0",
87
- "eslint": "^9.36.0",
84
+ "@types/node": "^24.7.2",
85
+ "@types/react": "^19.2.2",
86
+ "@typescript-eslint/utils": "^8.46.1",
87
+ "eslint": "^9.37.0",
88
88
  "jest": "^30.2.0",
89
89
  "jiti": "^2.6.1",
90
90
  "premove": "^4.0.0",
91
- "stylelint": "^16.24.0",
91
+ "stylelint": "^16.25.0",
92
92
  "ts-patch": "^3.3.0",
93
93
  "typescript": "^5.9.3",
94
94
  "typescript-transform-paths": "^3.5.5"