@open-xchange/linter-presets 0.12.0 → 0.12.2

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## `0.12.2` – 2024-Dec-13
4
+
5
+ - change: (ESLint) raise all recommended Vue rules to "error" level
6
+
7
+ ## `0.12.1` – 2024-Dec-13
8
+
9
+ - chore: bump dependencies
10
+ - add: (ESLint) support for React v19
11
+
3
12
  ## `0.12.0` – 2024-Dec-06
4
13
 
5
14
  - chore: bump dependencies
@@ -1,7 +1,7 @@
1
1
  import vuePlugin from "eslint-plugin-vue";
2
2
  import vueParser from "vue-eslint-parser";
3
3
  import tseslint from "typescript-eslint";
4
- import { fixMissingFilesOption, getCommaDangleConfig } from "../shared/env-utils.js";
4
+ import { fixMissingFilesOption, convertRuleWarningsToErrors, getCommaDangleConfig } from "../shared/env-utils.js";
5
5
  // functions ==================================================================
6
6
  /**
7
7
  * Creates configuration objects with linter rules for Vue.js.
@@ -19,6 +19,8 @@ import { fixMissingFilesOption, getCommaDangleConfig } from "../shared/env-utils
19
19
  * An array of configuration objects to be added to the flat configuration.
20
20
  */
21
21
  export default function vue(languageConfig, stylisticConfig) {
22
+ // recommended configuration of the main plugin
23
+ const recommendedConfigs = vuePlugin.configs["flat/recommended"];
22
24
  // add missing "files" property in configurations with rules (otherwise, plugin conflicts with "@eslint/markdown")
23
25
  return fixMissingFilesOption([
24
26
  // use TypeScript parser for Vue files
@@ -33,7 +35,11 @@ export default function vue(languageConfig, stylisticConfig) {
33
35
  },
34
36
  },
35
37
  // register rule implementations and recommended rules
36
- ...vuePlugin.configs["flat/recommended"],
38
+ ...recommendedConfigs,
39
+ // raise all recommended rules to "error" level
40
+ ...recommendedConfigs.map(config => ({
41
+ rules: convertRuleWarningsToErrors(config.rules ?? {}),
42
+ })),
37
43
  // reconfigure plugin rules
38
44
  {
39
45
  rules: {
@@ -37,7 +37,7 @@ export default function react(envOptions) {
37
37
  // register rule implementations and language settings
38
38
  ...recommendedConfig,
39
39
  rules: {
40
- // recommended rules (move all to error level)
40
+ // raise all recommended rules to "error" level
41
41
  ...convertRuleWarningsToErrors(recommendedConfig.rules),
42
42
  // custom overrides
43
43
  "@eslint-react/jsx-no-duplicate-props": "error",
@@ -47,6 +47,7 @@ export default function react(envOptions) {
47
47
  "@eslint-react/no-implicit-key": "error",
48
48
  "@eslint-react/no-missing-component-display-name": "error",
49
49
  "@eslint-react/no-useless-fragment": "error",
50
+ "@eslint-react/prefer-read-only-props": "error",
50
51
  "@eslint-react/prefer-shorthand-boolean": "error",
51
52
  "@eslint-react/prefer-shorthand-fragment": "error",
52
53
  "@eslint-react/dom/no-unknown-property": "error",
@@ -258,7 +258,7 @@ export declare function fixMissingFilesOption(configs: Linter.Config[]): Linter.
258
258
  * @returns
259
259
  * The converted rules record.
260
260
  */
261
- export declare function convertRuleWarningsToErrors(rules: Linter.RulesRecord): Linter.RulesRecord;
261
+ export declare function convertRuleWarningsToErrors(rules: Partial<Linter.RulesRecord>): Partial<Linter.RulesRecord>;
262
262
  /**
263
263
  * Translates the stylistic option `dangle` to the configuration options for
264
264
  * "comma-dangle" rules.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,15 +25,15 @@
25
25
  "@babel/eslint-parser": "^7.25.9",
26
26
  "@babel/plugin-proposal-decorators": "^7.25.9",
27
27
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
28
- "@eslint-react/eslint-plugin": "^1.17.3",
28
+ "@eslint-react/eslint-plugin": "^1.19.0",
29
29
  "@eslint/compat": "^1.2.4",
30
30
  "@eslint/js": "^9.16.0",
31
31
  "@eslint/markdown": "^6.2.1",
32
- "@stylistic/eslint-plugin": "^2.11.0",
33
- "@stylistic/eslint-plugin-migrate": "^2.11.0",
32
+ "@stylistic/eslint-plugin": "^2.12.1",
33
+ "@stylistic/eslint-plugin-migrate": "^2.12.1",
34
34
  "@stylistic/stylelint-config": "^2.0.0",
35
35
  "@stylistic/stylelint-plugin": "^3.1.1",
36
- "@vitest/eslint-plugin": "^1.1.14",
36
+ "@vitest/eslint-plugin": "^1.1.16",
37
37
  "confusing-browser-globals": "^1.0.11",
38
38
  "eslint-import-resolver-typescript": "^3.7.0",
39
39
  "eslint-plugin-chai-expect": "^3.1.0",
@@ -42,16 +42,16 @@
42
42
  "eslint-plugin-import": "^2.31.0",
43
43
  "eslint-plugin-jest": "^28.9.0",
44
44
  "eslint-plugin-jest-dom": "^5.5.0",
45
- "eslint-plugin-jsdoc": "^50.6.0",
45
+ "eslint-plugin-jsdoc": "^50.6.1",
46
46
  "eslint-plugin-jsonc": "^2.18.2",
47
47
  "eslint-plugin-jsx-a11y": "^6.10.2",
48
48
  "eslint-plugin-license-header": "^0.6.1",
49
- "eslint-plugin-n": "^17.14.0",
49
+ "eslint-plugin-n": "^17.15.0",
50
50
  "eslint-plugin-promise": "^7.2.1",
51
51
  "eslint-plugin-react-hooks": "^5.1.0",
52
52
  "eslint-plugin-react-hooks-static-deps": "^1.0.7",
53
53
  "eslint-plugin-react-refresh": "^0.4.16",
54
- "eslint-plugin-testing-library": "^7.1.0",
54
+ "eslint-plugin-testing-library": "^7.1.1",
55
55
  "eslint-plugin-vue": "^9.32.0",
56
56
  "eslint-plugin-yml": "^1.16.0",
57
57
  "find-up": "^7.0.0",
@@ -63,13 +63,13 @@
63
63
  "stylelint-config-standard-scss": "^14.0.0",
64
64
  "stylelint-config-standard-vue": "^1.0.0",
65
65
  "stylelint-plugin-license-header": "^1.0.3",
66
- "typescript-eslint": "^8.17.0",
66
+ "typescript-eslint": "^8.18.0",
67
67
  "vue-eslint-parser": "^9.4.3"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/confusing-browser-globals": "^1.0.3",
71
71
  "@types/picomatch": "^3.0.1",
72
- "@typescript-eslint/utils": "^8.17.0",
72
+ "@typescript-eslint/utils": "^8.18.0",
73
73
  "eslint": "^9.16.0",
74
74
  "jest": "^29.7.0",
75
75
  "rimraf": "^6.0.1",