@linter-spec/cli 1.0.1 → 1.0.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.
@@ -16,6 +16,28 @@ export function hasLocalLintConfig(cwd) {
16
16
  '.markdownlint?(-cli2).@(jsonc|json|yaml|yml|cjs|mjs)',
17
17
  ], { cwd, dot: true }).length > 0);
18
18
  }
19
+ /**
20
+ * Version ranges to pin so npm/pnpm don't pull a major that the config doesn't
21
+ * support yet. Mirrors `@linter-spec/eslint-config`'s `peerDependencies` —
22
+ * e.g., ESLint 10 changed `context.getFilename()` to `context.filename`, which
23
+ * crashes `eslint-plugin-react@7` at rule-load time. Keep this in sync with
24
+ * eslint-config's peers if those ranges bump.
25
+ */
26
+ const PINNED_VERSIONS = {
27
+ eslint: '^9.0.0',
28
+ typescript: '^5.6.2',
29
+ 'typescript-eslint': '^8.8.1',
30
+ 'eslint-plugin-react': '^7.37.1',
31
+ 'eslint-plugin-react-hooks': '^5.0.0',
32
+ 'eslint-plugin-jsx-a11y': '^6.10.0',
33
+ 'eslint-plugin-vue': '^9.28.0',
34
+ 'vue-eslint-parser': '^9.4.3',
35
+ 'eslint-plugin-n': '^17.10.3',
36
+ };
37
+ function pin(name) {
38
+ const v = PINNED_VERSIONS[name];
39
+ return v ? `${name}@${v}` : name;
40
+ }
19
41
  /**
20
42
  * The npm packages to install as devDependencies of the user's project so that
21
43
  * the generated `eslint.config.mjs` (and friends) can resolve everything they
@@ -61,7 +83,7 @@ export function projectDepsToInstall(config) {
61
83
  if (config.enablePrettier) {
62
84
  deps.add('prettier');
63
85
  }
64
- return [...deps];
86
+ return [...deps].map(pin);
65
87
  }
66
88
  /**
67
89
  * Install everything the chosen lint setup needs (CLI + eslint-config +
@@ -25,6 +25,6 @@ _%>
25
25
  "isolatedModules": true,
26
26
  "noEmit": true
27
27
  },
28
- "include": ["src/**/*"<% if (isReact) { %>, "src/**/*.tsx"<% } %><% if (isVue) { %>, "src/**/*.vue"<% } %>],
29
- "exclude": ["node_modules", "dist", "build", "coverage"]
28
+ "include": ["**/*.ts"<% if (isReact) { %>, "**/*.tsx"<% } %><% if (isVue) { %>, "**/*.vue"<% } %>],
29
+ "exclude": ["node_modules", "dist", "build", "coverage", ".next", ".nuxt", ".turbo"]
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linter-spec/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "One-command lint toolchain (ESLint / Stylelint / markdownlint / Prettier / commitlint) for the linter-spec spec.",
5
5
  "type": "module",
6
6
  "author": "SotherWind",
@@ -61,10 +61,10 @@
61
61
  "stylelint": "^17.13.0",
62
62
  "terminal-link": "^5.0.0",
63
63
  "text-table": "^0.2.0",
64
- "@linter-spec/commitlint-config": "^1.0.0",
64
+ "@linter-spec/markdownlint-config": "^1.0.0",
65
65
  "@linter-spec/eslint-config": "^1.0.0",
66
- "@linter-spec/stylelint-config": "^1.0.0",
67
- "@linter-spec/markdownlint-config": "^1.0.0"
66
+ "@linter-spec/commitlint-config": "^1.0.0",
67
+ "@linter-spec/stylelint-config": "^1.0.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/cross-spawn": "^6.0.6",