@open-xchange/linter-presets 1.2.0 → 1.2.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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.2.2` – 2025-Jan-11
4
+
5
+ - fix: (ESLint) support all configuration file extensions
6
+
7
+ ## `1.2.1` – 2025-Jan-10
8
+
9
+ - chore: bump dependencies
10
+
3
11
  ## `1.2.0` – 2025-Jan-09
4
12
 
5
13
  - change: (ESLint) move support for native decorators in JS files into own environment `env.decorators`
@@ -142,7 +142,7 @@ export function customRules(envOptions, rules) {
142
142
  * The fixed configuration options.
143
143
  */
144
144
  export function fixMissingFilesOption(configs) {
145
- const files = configs.find(config => config.files)?.files;
145
+ const files = configs.find(config => !!config.files)?.files;
146
146
  return files ? configs.map(config => (!config.files && (config.languageOptions || config.rules)) ? { ...config, files } : config) : configs;
147
147
  }
148
148
  /**
@@ -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.0",
3
+ "version": "1.2.2",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
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.23.1",
28
+ "@eslint-react/eslint-plugin": "^1.23.2",
29
29
  "@eslint/compat": "^1.2.4",
30
30
  "@eslint/js": "^9.17.0",
31
31
  "@eslint/markdown": "^6.2.1",
@@ -62,18 +62,19 @@
62
62
  "stylelint-config-standard-scss": "^14.0.0",
63
63
  "stylelint-config-standard-vue": "^1.0.0",
64
64
  "stylelint-plugin-license-header": "^1.0.3",
65
- "typescript-eslint": "^8.19.0",
65
+ "typescript-eslint": "^8.19.1",
66
66
  "vue-eslint-parser": "^9.4.3"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/confusing-browser-globals": "^1.0.3",
70
70
  "@types/picomatch": "^3.0.1",
71
- "@typescript-eslint/utils": "^8.19.0",
71
+ "@typescript-eslint/utils": "^8.19.1",
72
+ "better-typescript-lib": "^2.10.0",
72
73
  "eslint": "^9.17.0",
73
74
  "jest": "^29.7.0",
74
75
  "premove": "^4.0.0",
75
76
  "stylelint": "^16.12.0",
76
- "typescript": "^5.7.2"
77
+ "typescript": "^5.7.3"
77
78
  },
78
79
  "peerDependencies": {
79
80
  "eslint": "^9.15.0",