@open-xchange/linter-presets 1.2.1 → 1.2.3

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
+ ## `1.2.3` – 2025-Jan-11
4
+
5
+ - add: (ESLint) ignore NuxtJS output directories (`.nuxt` and `.output`)
6
+ - fix: (ESLint) bundle types for `picomatch`
7
+
8
+ ## `1.2.2` – 2025-Jan-11
9
+
10
+ - fix: (ESLint) support all configuration file extensions
11
+
3
12
  ## `1.2.1` – 2025-Jan-10
4
13
 
5
14
  - chore: bump dependencies
@@ -55,6 +55,8 @@ export function configure(options) {
55
55
  "vite.config.ts.*.mjs",
56
56
  "gitlab-ci/*",
57
57
  ".gitlab-ci.yml",
58
+ ".nuxt", // NuxtJS
59
+ ".output", // NuxtJS
58
60
  ...(options?.ignores ?? []),
59
61
  ];
60
62
  // resolve language configuration options
@@ -6,6 +6,14 @@ import { findUpSync } from "find-up";
6
6
  import { AST_NODE_TYPES as NodeType } from "@typescript-eslint/utils";
7
7
  // constants ==================================================================
8
8
  const FILE_EXTENSIONS = ["js", "ts", "d.ts"];
9
+ const CONFIG_FILES = [
10
+ "eslint.config.js",
11
+ "eslint.config.mjs",
12
+ "eslint.config.cjs",
13
+ "eslint.config.ts",
14
+ "eslint.config.mts",
15
+ "eslint.config.cts",
16
+ ];
9
17
  // Schema =====================================================================
10
18
  /**
11
19
  * Helper functions to build a JSON schema for custom ESLint rules.
@@ -133,10 +141,13 @@ export class ProjectContext {
133
141
  const sharedSettings = context.settings["env-project"];
134
142
  this.#aliasMap = new Map(Object.entries(sharedSettings?.alias ?? {}));
135
143
  // resolve root directory
136
- const configPath = findUpSync("eslint.config.js");
137
- const rootDir = configPath && toPosixPath(dirname(configPath));
144
+ const configPath = findUpSync(CONFIG_FILES);
145
+ if (!configPath) {
146
+ throw new Error("cannot find configuration file");
147
+ }
148
+ const rootDir = toPosixPath(dirname(configPath));
138
149
  const fileName = toPosixPath(context.filename);
139
- if (!rootDir || !fileName.startsWith(rootDir + "/")) {
150
+ if (!fileName.startsWith(rootDir + "/")) {
140
151
  throw new Error("invalid root directory");
141
152
  }
142
153
  this.#rootDir = rootDir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "prepare": "yarn build",
18
18
  "prepack": "yarn build && yarn lint && yarn test",
19
19
  "build": "premove dist && tsc",
20
- "lint": "eslint .",
20
+ "lint": "tsc --project tsconfig.config.json && eslint .",
21
21
  "test": "cd test && eslint ."
22
22
  },
23
23
  "dependencies": {
@@ -33,6 +33,7 @@
33
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
+ "@types/picomatch": "^3.0.1",
36
37
  "@vitest/eslint-plugin": "^1.1.24",
37
38
  "confusing-browser-globals": "^1.0.11",
38
39
  "eslint-plugin-chai-expect": "^3.1.0",
@@ -66,12 +67,14 @@
66
67
  "vue-eslint-parser": "^9.4.3"
67
68
  },
68
69
  "devDependencies": {
70
+ "@humanwhocodes/momoa": "^3.3.6",
69
71
  "@types/confusing-browser-globals": "^1.0.3",
70
- "@types/picomatch": "^3.0.1",
72
+ "@types/eslint-scope": "^3.7.7",
71
73
  "@typescript-eslint/utils": "^8.19.1",
72
74
  "better-typescript-lib": "^2.10.0",
73
- "eslint": "^9.17.0",
75
+ "eslint": "^9.18.0",
74
76
  "jest": "^29.7.0",
77
+ "jiti": "^2.4.2",
75
78
  "premove": "^4.0.0",
76
79
  "stylelint": "^16.12.0",
77
80
  "typescript": "^5.7.3"
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "../../tsconfig/tsconfig.config.json",
4
+ "include": ["*.ts"]
5
+ }