@open-xchange/linter-presets 0.1.4 → 0.1.6

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.
@@ -20,9 +20,10 @@ function project(options: EnvProjectOptions): Linter.FlatConfig[]
20
20
  | - | - | - | - |
21
21
  | `files` | `string[]` | _required_ | Glob patterns for source files to be included. |
22
22
  | `ignores` | `string[]` | `[]` | Glob patterns for source files matching `files` to be ignored. |
23
- | `alias` | `Record<string, string>` | `{}` | Maps all alias prefixes to actual paths in the project (see below). |
24
- | `external` | `string \| string[]` | `[]` | Specifies glob patterns for external modules (see below). |
25
- | `packages` | `Record<string, EnvProjectPackage>` | `{}` | Allows to separate the source files into virtual packages (see below). |
23
+ | `modules` | `RuleNoInvalidModulesOptions` | `{}` | Configuration for the rule "env-project/no-invalid-modules": |
24
+ | `modules.alias` | `Record<string, string>` | `{}` | Maps all alias prefixes to actual paths in the project (see below). |
25
+ | `modules.external` | `string \| string[]` | `[]` | Specifies glob patterns for external modules (see below). |
26
+ | `modules.packages` | `Record<string, EnvProjectPackage>` | `{}` | Allows to separate the source files into virtual packages (see below). |
26
27
  | `rules` | `Linter.RulesRecord` | `{}` | Additional linter rules to be added to the configuration. |
27
28
 
28
29
  ### Option `alias`
@@ -42,8 +43,10 @@ export default [
42
43
  ...eslint.configure({ /* ... */ }),
43
44
  ...eslint.env.project({
44
45
  files: ["src/**/*.{js,ts}"],
45
- alias: {
46
+ modules: {
47
+ alias: {
46
48
  "@": "src",
49
+ },
47
50
  },
48
51
  }),
49
52
  ]
@@ -69,8 +72,10 @@ export default [
69
72
  ...eslint.configure({ /* ... */ }),
70
73
  ...eslint.env.project({
71
74
  files: ["src/**/*.{js,ts}"],
72
- alias: { "@": "src" },
73
- external: ["virtual:*", "@/special/lib/**/*.js"],
75
+ modules: {
76
+ alias: { "@": "src" },
77
+ external: ["virtual:*", "@/special/lib/**/*.js"],
78
+ },
74
79
  }),
75
80
  ]
76
81
  ```
@@ -105,19 +110,21 @@ export default [
105
110
  ...eslint.configure({ /* ... */ }),
106
111
  ...eslint.env.project({
107
112
  files: ["src/**/*.{js,ts}"],
108
- alias: { "@": "src" },
109
- packages: {
110
- base: {
111
- src: ["@/base/**/*", "@/tools/**/*"],
112
- },
113
- debug: {
114
- src: "@/debug/**/*",
115
- extends: "base",
116
- optional: true,
117
- },
118
- special: {
119
- src: "@/my/special/**/*",
120
- extends: ["base", "debug"],
113
+ modules: {
114
+ alias: { "@": "src" },
115
+ packages: {
116
+ base: {
117
+ src: ["@/base/**/*", "@/tools/**/*"],
118
+ },
119
+ debug: {
120
+ src: "@/debug/**/*",
121
+ extends: "base",
122
+ optional: true,
123
+ },
124
+ special: {
125
+ src: "@/my/special/**/*",
126
+ extends: ["base", "debug"],
127
+ },
121
128
  },
122
129
  },
123
130
  }),
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.4",
4
+ "version": "0.1.6",
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"
@@ -15,15 +15,16 @@
15
15
  "exports": "./dist/index.js",
16
16
  "scripts": {
17
17
  "prepare": "husky",
18
- "prepack": "yarn lint && yarn build",
18
+ "prepack": "yarn build && yarn lint && yarn test",
19
19
  "build": "npx --yes rimraf dist && tsc",
20
- "lint": "eslint ."
20
+ "lint": "eslint .",
21
+ "test": "cd test && eslint ."
21
22
  },
22
23
  "lint-staged": {
23
24
  "*.{js,ts,json}": "yarn lint"
24
25
  },
25
26
  "dependencies": {
26
- "@babel/core": "7.24.8",
27
+ "@babel/core": "7.24.9",
27
28
  "@babel/eslint-parser": "7.24.8",
28
29
  "@babel/plugin-proposal-decorators": "7.24.7",
29
30
  "@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
@@ -40,39 +41,39 @@
40
41
  "eslint-plugin-import": "2.29.1",
41
42
  "eslint-plugin-jest": "28.6.0",
42
43
  "eslint-plugin-jest-dom": "5.4.0",
43
- "eslint-plugin-jsdoc": "48.7.0",
44
+ "eslint-plugin-jsdoc": "48.8.3",
44
45
  "eslint-plugin-jsonc": "2.16.0",
45
46
  "eslint-plugin-jsx-a11y": "6.9.0",
46
47
  "eslint-plugin-jsx-expressions": "1.3.2",
47
48
  "eslint-plugin-license-header": "0.6.1",
48
49
  "eslint-plugin-n": "17.9.0",
49
- "eslint-plugin-promise": "6.4.0",
50
- "eslint-plugin-react": "7.34.4",
50
+ "eslint-plugin-promise": "6.6.0",
51
+ "eslint-plugin-react": "7.35.0",
51
52
  "eslint-plugin-react-hooks": "4.6.2",
52
53
  "eslint-plugin-react-hooks-static-deps": "1.0.7",
53
- "eslint-plugin-react-refresh": "0.4.8",
54
+ "eslint-plugin-react-refresh": "0.4.9",
54
55
  "eslint-plugin-testing-library": "6.2.2",
55
56
  "eslint-plugin-vitest": "0.5.4",
56
57
  "eslint-plugin-yml": "1.14.0",
58
+ "find-up": "7.0.0",
57
59
  "globals": "15.8.0",
58
- "package-up": "5.0.0",
59
60
  "picomatch": "4.0.2",
60
61
  "stylelint-config-standard": "36.0.1",
61
62
  "stylelint-config-standard-less": "3.0.1",
62
63
  "stylelint-config-standard-scss": "13.1.0",
63
64
  "stylelint-plugin-license-header": "1.0.3",
64
- "typescript-eslint": "7.16.0"
65
+ "typescript-eslint": "7.17.0"
65
66
  },
66
67
  "devDependencies": {
67
68
  "@types/confusing-browser-globals": "1.0.3",
68
69
  "@types/eslint__js": "8.42.3",
69
70
  "@types/picomatch": "3.0.0",
70
- "@typescript-eslint/utils": "7.16.0",
71
+ "@typescript-eslint/utils": "7.17.0",
71
72
  "eslint": "9.7.0",
72
- "husky": "9.0.11",
73
+ "husky": "9.1.1",
73
74
  "jest": "29.7.0",
74
75
  "stylelint": "16.7.0",
75
- "typescript": "5.5.3"
76
+ "typescript": "5.5.4"
76
77
  },
77
78
  "peerDependencies": {
78
79
  "eslint": "^9.6",
@@ -0,0 +1,26 @@
1
+
2
+ // eslint-disable-next-line env-project/no-amd-module-directive
3
+ /// <amd-module name="file1"/>
4
+
5
+ // valid imports
6
+ import "find-up";
7
+ import "$/external/module";
8
+ import "@/project1/generated";
9
+
10
+ // eslint-disable-next-line env-project/no-invalid-modules
11
+ import "invalid-package";
12
+ // eslint-disable-next-line env-project/no-invalid-modules
13
+ import "@/project1/invalid";
14
+ // eslint-disable-next-line env-project/no-invalid-modules
15
+ import "@/project2/file2";
16
+ // eslint-disable-next-line env-project/no-invalid-modules
17
+ import "@/project3/file3";
18
+
19
+ await import("find-up");
20
+ await import("@/project1/generated");
21
+ await import("@/project3/file3");
22
+
23
+ // eslint-disable-next-line env-project/no-invalid-modules
24
+ await import("invalid-package");
25
+ // eslint-disable-next-line env-project/no-invalid-modules
26
+ await import("@/project2/file2");
@@ -0,0 +1,2 @@
1
+
2
+ import "@/project1/file1";
@@ -0,0 +1,3 @@
1
+
2
+ import "@/project1/file1";
3
+ import "@/project2/file2";