@open-xchange/linter-presets 1.12.0 → 1.14.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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.14.0` – 2025-Oct-16
4
+
5
+ - added: (ESLint) plugin `eslint-plugin-no-unsanitized` for `env.browser`
6
+
7
+ ## `1.13.0` – 2025-Oct-16
8
+
9
+ - chore: bump dependencies
10
+ - changed: (ESLint) `@eslint-react/eslint-plugin`: switch to "strict-type-checked" preset
11
+ - added: (ESLint) rule `jsdoc/ts-no-unnecessary-template-expression`
12
+
3
13
  ## `1.12.0` – 2025-Oct-09
4
14
 
5
15
  - chore: bump dependencies
@@ -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
  ];
@@ -12,6 +12,7 @@ export interface EnvBrowserOptions extends EnvRestrictedOptions {
12
12
  * Wraps the following packages:
13
13
  * - `globals`
14
14
  * - `confusing-browser-globals`
15
+ * - `eslint-plugin-no-unsanitized`
15
16
  *
16
17
  * @param envOptions
17
18
  * Configuration options for the environment.
@@ -1,5 +1,6 @@
1
1
  import JAVASCRIPT_GLOBALS from "globals";
2
2
  import CONFUSING_BROWSER_GLOBALS from "confusing-browser-globals";
3
+ import sanitizedPlugin from "eslint-plugin-no-unsanitized";
3
4
  import { createConfig, customRules } from "../shared/env-utils.js";
4
5
  import { restrictedRulesConfig } from "../shared/restricted.js";
5
6
  // constants ==================================================================
@@ -80,6 +81,7 @@ const RESTRICTED_GLOBALS = AMBIGUOUS_BROWSER_TYPES.map(name => {
80
81
  * Wraps the following packages:
81
82
  * - `globals`
82
83
  * - `confusing-browser-globals`
84
+ * - `eslint-plugin-no-unsanitized`
83
85
  *
84
86
  * @param envOptions
85
87
  * Configuration options for the environment.
@@ -90,18 +92,20 @@ const RESTRICTED_GLOBALS = AMBIGUOUS_BROWSER_TYPES.map(name => {
90
92
  export default function browser(envOptions) {
91
93
  return [
92
94
  // register global symbols used in browser scripts
93
- createConfig("core.browser.globals", envOptions, {
95
+ createConfig("env.browser.globals", envOptions, {
94
96
  languageOptions: {
95
97
  globals: BROWSER_GLOBALS,
96
98
  },
97
99
  }),
98
100
  // generate the "no-restricted-?" rules according to passed configuration
99
- restrictedRulesConfig("core.browser.restricted", envOptions, {
101
+ restrictedRulesConfig("env.browser.restricted", envOptions, {
100
102
  globals: RESTRICTED_GLOBALS,
101
103
  properties: RESTRICTED_PROPERTIES,
102
104
  syntax: RESTRICTED_SYNTAX,
103
105
  }),
106
+ // register rule implementations and recommended rules
107
+ createConfig("env.browser.sanitized", envOptions, sanitizedPlugin.configs.recommended),
104
108
  // custom rules
105
- customRules("core.browser.rules", envOptions),
109
+ customRules("env.browser.rules", envOptions),
106
110
  ];
107
111
  }
@@ -26,6 +26,7 @@ const reactHooksPlugin = reactHooksPluginModule;
26
26
  * The configuration entries to be added to the resulting configuration array.
27
27
  */
28
28
  export default function react(envOptions) {
29
+ const reactConfig = reactPlugin.configs["strict-type-checked"];
29
30
  return [
30
31
  // configure "react" plugin for all source files (JSX and TSX)
31
32
  createConfig("env.react.recommended", envOptions, {
@@ -35,10 +36,10 @@ export default function react(envOptions) {
35
36
  parserOptions: { projectService: true },
36
37
  },
37
38
  // register rule implementations and language settings, raise all recommended rules to "error" level
38
- ...convertRuleWarningsToErrors(reactPlugin.configs["recommended-type-checked"]),
39
+ ...convertRuleWarningsToErrors(reactConfig),
39
40
  // additional settings
40
41
  settings: {
41
- ...reactPlugin.configs["recommended-type-checked"].settings,
42
+ ...reactConfig.settings,
42
43
  ...(envOptions.effectHooks?.length ? {
43
44
  "react-hooks": {
44
45
  additionalEffectHooks: `^(${envOptions.effectHooks.join("|")})$`,
@@ -48,20 +49,16 @@ export default function react(envOptions) {
48
49
  }, {
49
50
  // custom overrides
50
51
  "@eslint-react/jsx-no-iife": "error",
51
- "@eslint-react/jsx-no-duplicate-props": "error",
52
52
  "@eslint-react/jsx-no-undef": "error",
53
53
  "@eslint-react/jsx-shorthand-boolean": "error",
54
54
  "@eslint-react/jsx-shorthand-fragment": "error",
55
- "@eslint-react/jsx-uses-vars": "error",
56
- "@eslint-react/no-children-prop": "error",
57
- "@eslint-react/no-class-component": "error",
58
55
  "@eslint-react/no-missing-component-display-name": "error",
59
- "@eslint-react/no-unnecessary-use-callback": "error",
60
- "@eslint-react/no-unnecessary-use-memo": "error",
61
- "@eslint-react/no-useless-fragment": "error",
56
+ "@eslint-react/no-missing-context-display-name": "error",
62
57
  "@eslint-react/prefer-namespace-import": "error",
63
58
  "@eslint-react/prefer-read-only-props": "error",
64
59
  "@eslint-react/dom/no-unknown-property": "error",
60
+ "@eslint-react/naming-convention/component-name": "error",
61
+ "@eslint-react/naming-convention/context-name": "error",
65
62
  "@eslint-react/naming-convention/filename-extension": ["error", { allow: "as-needed" }],
66
63
  }),
67
64
  // "react-hooks" plugin and recommended rules, raise all recommended rules to "error" level
@@ -1,6 +1,8 @@
1
1
  # Environment `env.browser`
2
2
 
3
- Creates configuration objects with global symbols and linter rules for modules running in the browser. Adds well-known [browser globals](https://github.com/sindresorhus/globals), and forbids [confusing browser globals](https://github.com/facebook/create-react-app/tree/main/packages/confusing-browser-globals).
3
+ Creates configuration objects with global symbols and linter rules for modules running in the browser. Adds well-known [browser globals](https://github.com/sindresorhus/globals), and forbids [confusing browser globals](https://github.com/facebook/create-react-app/tree/main/packages/confusing-browser-globals). Adds the following plugins and their recommended rules:
4
+
5
+ - [eslint-plugin-no-unsanitized](https://github.com/mozilla/eslint-plugin-no-unsanitized/)
4
6
 
5
7
  ## Signature
6
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.12.0",
3
+ "version": "1.14.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": "^2.0.6",
37
+ "@eslint-react/eslint-plugin": "^2.2.2",
38
38
  "@eslint/compat": "^1.4.0",
39
39
  "@eslint/config-helpers": "^0.4.0",
40
40
  "@eslint/js": "^9.37.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.16",
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,18 +54,19 @@
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.0.1",
57
+ "eslint-plugin-jsdoc": "^61.1.4",
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",
61
61
  "eslint-plugin-n": "^17.23.1",
62
+ "eslint-plugin-no-unsanitized": "^4.1.4",
62
63
  "eslint-plugin-promise": "^7.2.1",
63
64
  "eslint-plugin-react-hooks": "^7.0.0",
64
65
  "eslint-plugin-react-hooks-static-deps": "^1.0.7",
65
- "eslint-plugin-react-refresh": "^0.4.23",
66
+ "eslint-plugin-react-refresh": "^0.4.24",
66
67
  "eslint-plugin-regexp": "^2.10.0",
67
- "eslint-plugin-testing-library": "^7.13.0",
68
- "eslint-plugin-vue": "^10.5.0",
68
+ "eslint-plugin-testing-library": "^7.13.3",
69
+ "eslint-plugin-vue": "^10.5.1",
69
70
  "eslint-plugin-yml": "^1.19.0",
70
71
  "globals": "^16.4.0",
71
72
  "picomatch": "^4.0.3",
@@ -75,15 +76,15 @@
75
76
  "stylelint-config-standard-scss": "^16.0.0",
76
77
  "stylelint-config-standard-vue": "^1.0.0",
77
78
  "stylelint-plugin-license-header": "^1.0.3",
78
- "typescript-eslint": "^8.46.0",
79
+ "typescript-eslint": "^8.46.1",
79
80
  "vue-eslint-parser": "^10.2.0"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@types/confusing-browser-globals": "^1.0.3",
83
84
  "@types/eslint-scope": "^8.3.2",
84
- "@types/node": "^24.7.0",
85
+ "@types/node": "^24.7.2",
85
86
  "@types/react": "^19.2.2",
86
- "@typescript-eslint/utils": "^8.46.0",
87
+ "@typescript-eslint/utils": "^8.46.1",
87
88
  "eslint": "^9.37.0",
88
89
  "jest": "^30.2.0",
89
90
  "jiti": "^2.6.1",