@open-xchange/linter-presets 0.8.1 → 0.8.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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## `0.8.2` – 2024-Sep-09
4
+
5
+ - chore: bump dependencies
6
+
3
7
  ## `0.8.1` – 2024-Sep-04
4
8
 
5
9
  - change: (ESLint) relax a few strict rules of `@typescript-eslint`
@@ -41,12 +41,16 @@ export default function importConfig(options) {
41
41
  espree: jsExtensions,
42
42
  "@typescript-eslint/parser": tsExtensions,
43
43
  },
44
+ "import/resolver": {
45
+ typescript: true,
46
+ node: true,
47
+ },
44
48
  },
45
49
  // reconfigure plugin rules
46
50
  rules: {
47
51
  // recommended rules
48
- ...importPlugin.configs.recommended.rules,
49
- ...importPlugin.configs.typescript.rules,
52
+ ...importPlugin.flatConfigs.recommended.rules,
53
+ ...importPlugin.flatConfigs.typescript.rules,
50
54
  // change or disable a few recommended rules
51
55
  "import/default": "off",
52
56
  "import/no-duplicates": "error",
@@ -41,22 +41,29 @@ export default function react(envOptions) {
41
41
  // recommended rules
42
42
  ...reactPlugin.configs.flat.recommended.rules,
43
43
  ...reactPlugin.configs.flat["jsx-runtime"].rules,
44
+ // custom overrides
45
+ "react/hook-use-state": "error",
46
+ "react/iframe-missing-sandbox": "error",
47
+ "react/jsx-boolean-value": "error",
48
+ "react/jsx-no-script-url": "error",
49
+ "react/jsx-no-useless-fragment": "error",
50
+ "react/jsx-props-no-spread-multi": "error",
51
+ "react/no-danger": "error",
52
+ "react/no-invalid-html-attribute": "error",
53
+ "react/no-typos": "error",
54
+ "react/prop-types": ["error", { skipUndeclared: true }],
55
+ "react/style-prop-object": "error",
56
+ "react/void-dom-elements-no-children": "error",
44
57
  },
45
58
  }),
46
- // configure other plugins and rules for all source files (JSX and TSX)
59
+ // "react-hooks" plugin
47
60
  createConfig(envOptions, {
48
61
  // register rule implementations of the plugins
49
62
  plugins: {
50
63
  "react-hooks": reactHooksPlugin,
51
- "react-refresh": reactRefreshPlugin,
52
- "jsx-expressions": fixupPluginRules(jsxExpressionsPlugin), // https://github.com/hluisson/eslint-plugin-jsx-expressions/issues/18
53
- "jsx-a11y": jsxA11yPlugin,
54
64
  },
55
65
  // recommended rules
56
- rules: {
57
- ...reactHooksPlugin.configs.recommended.rules,
58
- ...jsxA11yPlugin.flatConfigs.recommended.rules,
59
- },
66
+ rules: reactHooksPlugin.configs.recommended.rules,
60
67
  }),
61
68
  // "react-hooks-static-deps" plugin
62
69
  envOptions.staticHooks && createConfig(envOptions, {
@@ -68,30 +75,30 @@ export default function react(envOptions) {
68
75
  "react-hooks-static-deps/exhaustive-deps": ["error", { staticHooks: envOptions.staticHooks }],
69
76
  },
70
77
  }),
71
- // additional rules for TSX only
78
+ // "react-refresh" plugin
79
+ createConfig(envOptions, {
80
+ // register rule implementations of the plugins
81
+ plugins: {
82
+ "react-refresh": reactRefreshPlugin,
83
+ },
84
+ rules: {
85
+ "react-refresh/only-export-components": ["error", { allowConstantExport: true }],
86
+ },
87
+ }),
88
+ // "jsx-expressions" plugin (TSX only)
72
89
  createConfig(envOptions, {
73
90
  ignores: JS_GLOB,
91
+ // register rule implementations of the plugins
92
+ plugins: {
93
+ "jsx-expressions": fixupPluginRules(jsxExpressionsPlugin), // https://github.com/hluisson/eslint-plugin-jsx-expressions/issues/18
94
+ },
74
95
  rules: {
75
96
  // replace "react/jsx-no-leaked-render" rule with advanced alternative
76
97
  "jsx-expressions/strict-logical-expressions": "error",
77
98
  },
78
99
  }),
100
+ // "jsx-a11y" plugin
101
+ createConfig(envOptions, jsxA11yPlugin.flatConfigs.recommended),
79
102
  // custom rules
80
- customRules(envOptions, {
81
- // "react" plugin
82
- "react/hook-use-state": "error",
83
- "react/iframe-missing-sandbox": "error",
84
- "react/jsx-boolean-value": "error",
85
- "react/jsx-no-script-url": "error",
86
- "react/jsx-no-useless-fragment": "error",
87
- "react/jsx-props-no-spread-multi": "error",
88
- "react/no-danger": "error",
89
- "react/no-invalid-html-attribute": "error",
90
- "react/no-typos": "error",
91
- "react/prop-types": ["error", { skipUndeclared: true }],
92
- "react/style-prop-object": "error",
93
- "react/void-dom-elements-no-children": "error",
94
- // "react-refresh" plugin
95
- "react-refresh/only-export-components": ["error", { allowConstantExport: true }],
96
- }));
103
+ customRules(envOptions));
97
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,20 +33,21 @@
33
33
  "@stylistic/stylelint-config": "2.0.0",
34
34
  "@stylistic/stylelint-plugin": "3.0.1",
35
35
  "confusing-browser-globals": "1.0.11",
36
+ "eslint-import-resolver-typescript": "3.6.3",
36
37
  "eslint-plugin-chai-expect": "3.1.0",
37
38
  "eslint-plugin-codeceptjs": "1.3.0",
38
39
  "eslint-plugin-eslint-plugin": "6.2.0",
39
- "eslint-plugin-import": "2.29.1",
40
- "eslint-plugin-jest": "28.8.1",
40
+ "eslint-plugin-import": "2.30.0",
41
+ "eslint-plugin-jest": "28.8.3",
41
42
  "eslint-plugin-jest-dom": "5.4.0",
42
43
  "eslint-plugin-jsdoc": "50.2.2",
43
44
  "eslint-plugin-jsonc": "2.16.0",
44
- "eslint-plugin-jsx-a11y": "6.9.0",
45
+ "eslint-plugin-jsx-a11y": "6.10.0",
45
46
  "eslint-plugin-jsx-expressions": "1.3.2",
46
47
  "eslint-plugin-license-header": "0.6.1",
47
48
  "eslint-plugin-n": "17.10.2",
48
49
  "eslint-plugin-promise": "7.1.0",
49
- "eslint-plugin-react": "7.35.0",
50
+ "eslint-plugin-react": "7.35.2",
50
51
  "eslint-plugin-react-hooks": "4.6.2",
51
52
  "eslint-plugin-react-hooks-static-deps": "1.0.7",
52
53
  "eslint-plugin-react-refresh": "0.4.11",
@@ -60,14 +61,14 @@
60
61
  "stylelint-config-standard-less": "3.0.1",
61
62
  "stylelint-config-standard-scss": "13.1.0",
62
63
  "stylelint-plugin-license-header": "1.0.3",
63
- "typescript-eslint": "8.3.0"
64
+ "typescript-eslint": "8.4.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@eslint/core": "0.5.0",
67
+ "@eslint/core": "0.6.0",
67
68
  "@types/confusing-browser-globals": "1.0.3",
68
69
  "@types/eslint__js": "8.42.3",
69
70
  "@types/picomatch": "3.0.1",
70
- "@typescript-eslint/utils": "8.3.0",
71
+ "@typescript-eslint/utils": "8.4.0",
71
72
  "eslint": "9.9.1",
72
73
  "jest": "29.7.0",
73
74
  "rimraf": "6.0.1",