@caspeco/eslint-config-ts 5.0.0-beta.0 → 5.0.0

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/README.md CHANGED
@@ -31,12 +31,14 @@ This configuration includes:
31
31
 
32
32
  This package requires the following peer dependencies (automatically installed by npm 7+):
33
33
 
34
- - `@eslint/js` >=9
35
- - `eslint` >=9
36
- - `eslint-config-prettier` >=9
37
- - `eslint-plugin-check-file` >=2.8.0
38
- - `eslint-plugin-no-barrel-files` >=1.2.0
39
- - `typescript-eslint` >=8.39.0
34
+ - `@eslint/js`
35
+ - `eslint`
36
+ - `eslint-config-prettier`
37
+ - `eslint-plugin-check-file`
38
+ - `eslint-plugin-no-barrel-files`
39
+ - `typescript-eslint`
40
+
41
+ See [package.json](./package.json) for specific version requirements.
40
42
 
41
43
  ## Plugins
42
44
 
@@ -5,8 +5,11 @@
5
5
  *
6
6
  * This script updates:
7
7
  * - Package imports: @caspeco/eslint-config → @caspeco/eslint-config-ts
8
- * - Named imports: { vanillaConfig } → default import
9
- * - Variable references: vanillaConfig → config
8
+ * - Named imports: { vanillaConfig } → default import tsConfig
9
+ *
10
+ * Handles both:
11
+ * - Full migration: import { vanillaConfig } from "@caspeco/eslint-config"
12
+ * - Partial migration: import { vanillaConfig } from "@caspeco/eslint-config-ts"
10
13
  *
11
14
  * Usage:
12
15
  * npx caspeco-ts-migrate-v5 [path] [--dry-run]
@@ -36,14 +39,24 @@ function transformImports(content, filename) {
36
39
  let transformed = content;
37
40
  let hasChanges = false;
38
41
 
39
- // Replace import { vanillaConfig } from "@caspeco/eslint-config" → import config from "@caspeco/eslint-config-ts"
40
- const importPattern = /import\s*\{\s*vanillaConfig\s*\}\s*from\s*["']@caspeco\/eslint-config["']/;
41
- if (importPattern.test(transformed)) {
42
- transformed = transformed.replace(importPattern, 'import config from "@caspeco/eslint-config-ts"');
42
+ // Replace import { vanillaConfig } from "@caspeco/eslint-config" → import tsConfig from "@caspeco/eslint-config-ts"
43
+ // Also handle the case where package name is already updated but still using named import
44
+ const oldPackagePattern = /import\s*\{\s*vanillaConfig\s*\}\s*from\s*["']@caspeco\/eslint-config["']/;
45
+ const newPackagePattern = /import\s*\{\s*vanillaConfig\s*\}\s*from\s*["']@caspeco\/eslint-config-ts["']/;
46
+
47
+ if (oldPackagePattern.test(transformed)) {
48
+ transformed = transformed.replace(oldPackagePattern, 'import tsConfig from "@caspeco/eslint-config-ts"');
49
+ hasChanges = true;
50
+
51
+ // If we changed the import, also update variable references
52
+ transformed = transformed.replace(/\bvanillaConfig\b/g, "tsConfig");
53
+ } else if (newPackagePattern.test(transformed)) {
54
+ // Package name already updated, just change from named to default import
55
+ transformed = transformed.replace(newPackagePattern, 'import tsConfig from "@caspeco/eslint-config-ts"');
43
56
  hasChanges = true;
44
57
 
45
58
  // If we changed the import, also update variable references
46
- transformed = transformed.replace(/\bvanillaConfig\b/g, "config");
59
+ transformed = transformed.replace(/\bvanillaConfig\b/g, "tsConfig");
47
60
  }
48
61
 
49
62
  return { content: transformed, hasChanges };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/eslint-config-ts",
3
- "version": "5.0.0-beta.0",
3
+ "version": "5.0.0",
4
4
  "description": "Caspeco ESLint configuration for TypeScript projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -41,10 +41,6 @@
41
41
  "eslint-plugin-no-barrel-files": ">=1.2.0",
42
42
  "typescript-eslint": ">=8.39.0"
43
43
  },
44
- "engines": {
45
- "node": ">=24",
46
- "npm": ">=11.5.1"
47
- },
48
44
  "publishConfig": {
49
45
  "access": "public"
50
46
  }