@open-xchange/linter-presets 0.1.2 → 0.1.4

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.4] - 2024-07-15
4
+
5
+ - added: [ESLint] option `language.nativeDecorators` to support native ES decorators in JS files
6
+
7
+ ## [0.1.3] - 2024-07-15
8
+
9
+ - chore: bump dependencies
10
+
3
11
  ## [0.1.2] - 2024-07-12
4
12
 
5
13
  - added: [ESLint] option `restricted.nativeDecorators`
@@ -1,4 +1,5 @@
1
1
  import eslintJs from "@eslint/js";
2
+ import babelParser from "@babel/eslint-parser";
2
3
  // functions ==================================================================
3
4
  /**
4
5
  * Defines standard module settings and additional rules targeting JavaScript
@@ -18,7 +19,7 @@ export default function base(options) {
18
19
  const languageOptions = (sourceType, ...extensions) => {
19
20
  const { ecmaVersion } = options;
20
21
  return {
21
- files: extensions.map(ext => "*/**." + ext),
22
+ files: extensions.map(ext => "**/*." + ext),
22
23
  languageOptions: { ecmaVersion, sourceType },
23
24
  };
24
25
  };
@@ -36,6 +37,23 @@ export default function base(options) {
36
37
  languageOptions("commonjs", "cjs", "cts"),
37
38
  // ECMA version and module type for *.js and *.ts files
38
39
  languageOptions(options.sourceType, "js", "jsx", "ts", "tsx"),
40
+ // ECMA decorators via Babel plugin
41
+ ...(options.nativeDecorators ? [{
42
+ files: ["**/*.{js,jsx,mjs,cjs}"],
43
+ languageOptions: {
44
+ parser: babelParser,
45
+ parserOptions: {
46
+ requireConfigFile: false,
47
+ babelOptions: {
48
+ babelrc: false,
49
+ configFile: false,
50
+ plugins: [
51
+ ["@babel/plugin-proposal-decorators", { version: "2023-11" }],
52
+ ],
53
+ },
54
+ },
55
+ },
56
+ }] : []),
39
57
  // configure linter rules
40
58
  {
41
59
  files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
@@ -49,6 +49,7 @@ export function configure(options) {
49
49
  const languageOptions = {
50
50
  ecmaVersion: 2022,
51
51
  sourceType: "module",
52
+ nativeDecorators: false,
52
53
  ...options?.language,
53
54
  };
54
55
  // resolve stylistic configuration options
@@ -17,6 +17,12 @@ export interface LanguageOptions {
17
17
  * Default value is "module".
18
18
  */
19
19
  sourceType?: "module" | "commonjs";
20
+ /**
21
+ * Whether to support native ES decorators in JavaScript code (via Babel
22
+ * plugin). Does not affect TypeScript code which uses an own parser aware
23
+ * of the decorator syntax. Default value is `false`.
24
+ */
25
+ nativeDecorators?: boolean;
20
26
  }
21
27
  /**
22
28
  * Configuration options for code style.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@open-xchange/linter-presets",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "description": "Configuration presets for ESLint and StyleLint",
6
6
  "repository": {
7
7
  "url": "https://gitlab.open-xchange.com/fspd/npm-packages/linter-presets"
@@ -23,9 +23,12 @@
23
23
  "*.{js,ts,json}": "yarn lint"
24
24
  },
25
25
  "dependencies": {
26
+ "@babel/core": "7.24.8",
27
+ "@babel/eslint-parser": "7.24.8",
28
+ "@babel/plugin-proposal-decorators": "7.24.7",
26
29
  "@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
27
- "@eslint/compat": "1.1.0",
28
- "@eslint/js": "9.6.0",
30
+ "@eslint/compat": "1.1.1",
31
+ "@eslint/js": "9.7.0",
29
32
  "@stylistic/eslint-plugin": "2.3.0",
30
33
  "@stylistic/eslint-plugin-migrate": "2.3.0",
31
34
  "@stylistic/stylelint-config": "1.0.1",
@@ -37,14 +40,14 @@
37
40
  "eslint-plugin-import": "2.29.1",
38
41
  "eslint-plugin-jest": "28.6.0",
39
42
  "eslint-plugin-jest-dom": "5.4.0",
40
- "eslint-plugin-jsdoc": "48.6.0",
43
+ "eslint-plugin-jsdoc": "48.7.0",
41
44
  "eslint-plugin-jsonc": "2.16.0",
42
45
  "eslint-plugin-jsx-a11y": "6.9.0",
43
46
  "eslint-plugin-jsx-expressions": "1.3.2",
44
47
  "eslint-plugin-license-header": "0.6.1",
45
48
  "eslint-plugin-n": "17.9.0",
46
49
  "eslint-plugin-promise": "6.4.0",
47
- "eslint-plugin-react": "7.34.3",
50
+ "eslint-plugin-react": "7.34.4",
48
51
  "eslint-plugin-react-hooks": "4.6.2",
49
52
  "eslint-plugin-react-hooks-static-deps": "1.0.7",
50
53
  "eslint-plugin-react-refresh": "0.4.8",
@@ -65,10 +68,10 @@
65
68
  "@types/eslint__js": "8.42.3",
66
69
  "@types/picomatch": "3.0.0",
67
70
  "@typescript-eslint/utils": "7.16.0",
68
- "eslint": "9.6.0",
71
+ "eslint": "9.7.0",
69
72
  "husky": "9.0.11",
70
73
  "jest": "29.7.0",
71
- "stylelint": "16.6.1",
74
+ "stylelint": "16.7.0",
72
75
  "typescript": "5.5.3"
73
76
  },
74
77
  "peerDependencies": {
package/renovate.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": [
4
- "config:recommended"
5
- ],
6
- "lockFileMaintenance": {
7
- "enabled": true
8
- },
9
- "configMigration": true
10
- }