@open-xchange/linter-presets 1.13.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,9 @@
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
+
3
7
  ## `1.13.0` – 2025-Oct-16
4
8
 
5
9
  - chore: bump dependencies
@@ -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
  }
@@ -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.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -59,6 +59,7 @@
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",