@useinsider/eslint-config 4.0.0-beta.3 → 4.0.0-beta.4

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.
Files changed (48) hide show
  1. package/dist/cli.cjs +27 -8
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/{javascript-dom-CvtQ6_9W.cjs → javascript-dom-bySaQErv.cjs} +4 -4
  4. package/dist/{javascript-dom-CvtQ6_9W.cjs.map → javascript-dom-bySaQErv.cjs.map} +1 -1
  5. package/dist/{javascript-node-BNsy3loY.cjs → javascript-node-DZxexKer.cjs} +4 -4
  6. package/dist/{javascript-node-BNsy3loY.cjs.map → javascript-node-DZxexKer.cjs.map} +1 -1
  7. package/dist/{javascript-DH8-N38w.cjs → javascript-ycJ4W-e9.cjs} +5 -5
  8. package/dist/{javascript-DH8-N38w.cjs.map → javascript-ycJ4W-e9.cjs.map} +1 -1
  9. package/dist/{jest-4Es9Ggaa.cjs → jest-B2fpQmUB.cjs} +3 -3
  10. package/dist/{jest-4Es9Ggaa.cjs.map → jest-B2fpQmUB.cjs.map} +1 -1
  11. package/dist/main.cjs +30 -32
  12. package/dist/main.cjs.map +1 -1
  13. package/dist/main.js +4 -6
  14. package/dist/main.js.map +1 -1
  15. package/dist/{oxlintOwnership-7hpdB3d1.cjs → removedOptions-BYMW8w__.cjs} +29 -1
  16. package/dist/removedOptions-BYMW8w__.cjs.map +1 -0
  17. package/dist/{oxlintOwnership-Cx0hgA_J.js → removedOptions-Cb8SG8SI.js} +18 -2
  18. package/dist/removedOptions-Cb8SG8SI.js.map +1 -0
  19. package/dist/{stylistic-CoP3MT1Y.cjs → stylistic-B2hCwBRu.cjs} +4 -4
  20. package/dist/{stylistic-CoP3MT1Y.cjs.map → stylistic-B2hCwBRu.cjs.map} +1 -1
  21. package/dist/{typescript-D3VeLnpn.cjs → typescript-DdgbCNKI.cjs} +7 -7
  22. package/dist/{typescript-D3VeLnpn.cjs.map → typescript-DdgbCNKI.cjs.map} +1 -1
  23. package/dist/{typescript-dom-iB_xBTAD.cjs → typescript-dom-C0NNSGLd.cjs} +4 -4
  24. package/dist/{typescript-dom-iB_xBTAD.cjs.map → typescript-dom-C0NNSGLd.cjs.map} +1 -1
  25. package/dist/{typescript-node-Cq6qhj53.cjs → typescript-node-CjG8N83q.cjs} +4 -4
  26. package/dist/{typescript-node-Cq6qhj53.cjs.map → typescript-node-CjG8N83q.cjs.map} +1 -1
  27. package/dist/utils/removedOptions.d.ts +10 -0
  28. package/dist/{vitest-BlGQswK2.cjs → vitest-B3kOWOzo.cjs} +3 -3
  29. package/dist/{vitest-BlGQswK2.cjs.map → vitest-B3kOWOzo.cjs.map} +1 -1
  30. package/dist/{vue2-Da1i_oVn.cjs → vue2-DfL5FqeZ.cjs} +8 -8
  31. package/dist/{vue2-Da1i_oVn.cjs.map → vue2-DfL5FqeZ.cjs.map} +1 -1
  32. package/dist/{vue2-options-api-BSdrUm8H.cjs → vue2-options-api-sSrBV5Si.cjs} +8 -8
  33. package/dist/{vue2-options-api-BSdrUm8H.cjs.map → vue2-options-api-sSrBV5Si.cjs.map} +1 -1
  34. package/dist/{vue2-typescript-options-api-LM7U5dWq.cjs → vue2-typescript-options-api-CbRC2wf-.cjs} +10 -10
  35. package/dist/{vue2-typescript-options-api-LM7U5dWq.cjs.map → vue2-typescript-options-api-CbRC2wf-.cjs.map} +1 -1
  36. package/dist/{vue2-typescript-dXLRSGNP.cjs → vue2-typescript-rJIMzNUI.cjs} +10 -10
  37. package/dist/{vue2-typescript-dXLRSGNP.cjs.map → vue2-typescript-rJIMzNUI.cjs.map} +1 -1
  38. package/dist/{vue3-621EM2Ii.cjs → vue3-DmrGRHbo.cjs} +8 -8
  39. package/dist/{vue3-621EM2Ii.cjs.map → vue3-DmrGRHbo.cjs.map} +1 -1
  40. package/dist/{vue3-options-api-CC9_fAiq.cjs → vue3-options-api-DPEk8rBk.cjs} +8 -8
  41. package/dist/{vue3-options-api-CC9_fAiq.cjs.map → vue3-options-api-DPEk8rBk.cjs.map} +1 -1
  42. package/dist/{vue3-typescript-DONe-IKz.cjs → vue3-typescript-Dz5BM0LJ.cjs} +10 -10
  43. package/dist/{vue3-typescript-DONe-IKz.cjs.map → vue3-typescript-Dz5BM0LJ.cjs.map} +1 -1
  44. package/dist/{vue3-typescript-options-api-D4pqpDFs.cjs → vue3-typescript-options-api-DiYz_vVd.cjs} +10 -10
  45. package/dist/{vue3-typescript-options-api-D4pqpDFs.cjs.map → vue3-typescript-options-api-DiYz_vVd.cjs.map} +1 -1
  46. package/package.json +1 -1
  47. package/dist/oxlintOwnership-7hpdB3d1.cjs.map +0 -1
  48. package/dist/oxlintOwnership-Cx0hgA_J.js.map +0 -1
package/dist/cli.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_oxlintOwnership = require("./oxlintOwnership-7hpdB3d1.cjs");
3
+ const require_removedOptions = require("./removedOptions-BYMW8w__.cjs");
4
4
  let globals = require("globals");
5
- globals = require_oxlintOwnership.__toESM(globals, 1);
5
+ globals = require_removedOptions.__toESM(globals, 1);
6
6
  let node_fs = require("node:fs");
7
7
  let node_path = require("node:path");
8
8
  let node_url = require("node:url");
@@ -10,7 +10,7 @@ let _typescript_eslint_types = require("@typescript-eslint/types");
10
10
  let node_crypto = require("node:crypto");
11
11
  let node_os = require("node:os");
12
12
  let typescript = require("typescript");
13
- typescript = require_oxlintOwnership.__toESM(typescript, 1);
13
+ typescript = require_removedOptions.__toESM(typescript, 1);
14
14
  let _typescript_eslint_parser = require("@typescript-eslint/parser");
15
15
  //#region src/cli/detect.ts
16
16
  var FLAT_CONFIG_FILENAMES = [
@@ -423,6 +423,7 @@ var dependencies$7 = {
423
423
  };
424
424
  //#endregion
425
425
  //#region src/cli/resolveEslintConfigManifest.ts
426
+ var ESLINT_CONFIG_PACKAGE_NAME = "@useinsider/eslint-config";
426
427
  function tryReadManifest(candidate) {
427
428
  try {
428
429
  const raw = (0, node_fs.readFileSync)(candidate, "utf8");
@@ -451,11 +452,24 @@ function readOwnEslintConfigManifestFrom(runtimeDir) {
451
452
  function readOwnEslintConfigManifest$1() {
452
453
  return readOwnEslintConfigManifestFrom(resolveRuntimeDir());
453
454
  }
455
+ /**
456
+ * Install spec for the copy of `@useinsider/eslint-config` that is running right now, pinned to its
457
+ * own version. A dist-tag can never stand in for it: `latest` points at the previous major for as
458
+ * long as the current one ships on a prerelease tag, so resolving it downgrades the very consumer
459
+ * being scaffolded or migrated.
460
+ * @example
461
+ * ownEslintConfigSpec({ name: '@useinsider/eslint-config', version: '4.0.0-beta.3' });
462
+ * // '@useinsider/eslint-config@4.0.0-beta.3'
463
+ */
464
+ function ownEslintConfigSpec(manifest) {
465
+ const version = manifest.version?.trim();
466
+ if (!version) throw new Error(`Unable to read the running ${ESLINT_CONFIG_PACKAGE_NAME} version from its package.json. Refusing to install it from a dist-tag, which would downgrade this project.`);
467
+ return `${ESLINT_CONFIG_PACKAGE_NAME}@${version}`;
468
+ }
454
469
  //#endregion
455
470
  //#region src/cli/install.ts
456
471
  function toRequiredManifest(manifest) {
457
472
  return {
458
- version: manifest.version ?? "0.0.0",
459
473
  dependencies: manifest.dependencies ?? {},
460
474
  devDependencies: manifest.devDependencies ?? {},
461
475
  peerDependencies: manifest.peerDependencies ?? {},
@@ -482,7 +496,7 @@ function applyRecord(deps, manifest, record) {
482
496
  function buildDependencyList(answers, rawManifest = readOwnEslintConfigManifest$1()) {
483
497
  const manifest = toRequiredManifest(rawManifest);
484
498
  const deps = /* @__PURE__ */ new Set();
485
- deps.add(`@useinsider/eslint-config@${manifest.version}`);
499
+ deps.add(ownEslintConfigSpec(rawManifest));
486
500
  deps.add(pinned(manifest, "eslint"));
487
501
  deps.add(pinned(manifest, "globals"));
488
502
  applyRecord(deps, manifest, dependencies$14);
@@ -1900,7 +1914,7 @@ function resolveSpec(name, manifest, fallbacks) {
1900
1914
  function buildInstallList(scopes, manifest) {
1901
1915
  const specs = [];
1902
1916
  const fallbacks = [];
1903
- appendSpec(specs, "@useinsider/eslint-config@latest");
1917
+ appendSpec(specs, ownEslintConfigSpec(manifest));
1904
1918
  appendSpec(specs, resolveSpec("eslint", manifest, fallbacks));
1905
1919
  Object.entries(dependencies$14).forEach(([packageName, shouldInstall]) => {
1906
1920
  if (shouldInstall) appendSpec(specs, resolveSpec(packageName, manifest, fallbacks));
@@ -2234,8 +2248,8 @@ function formatDirective(owner, block, kind, rules, reason) {
2234
2248
  * movesToOxlint('@typescript-eslint/no-unused-vars', '.vue'); // false — ESLint still runs it in SFCs
2235
2249
  */
2236
2250
  function movesToOxlint(rule, fileExtension) {
2237
- if (!require_oxlintOwnership.isOxlintOwned(rule)) return false;
2238
- return !(SFC_EXTENSIONS.includes(fileExtension) && require_oxlintOwnership.isVueUnsafeRule(rule));
2251
+ if (!require_removedOptions.isOxlintOwned(rule)) return false;
2252
+ return !(SFC_EXTENSIONS.includes(fileExtension) && require_removedOptions.isVueUnsafeRule(rule));
2239
2253
  }
2240
2254
  function toSpans(comments, offset) {
2241
2255
  return comments.map((comment) => ({
@@ -4137,6 +4151,9 @@ function defineConfigReason(name) {
4137
4151
  function presetReason(name) {
4138
4152
  return `${name} still passes the v1 \`preset\` option, and this release could not read it — the preset list has to be an array of string literals. Restore the literal list and re-run the migration, or convert the call to the scope-keyed form by hand.`;
4139
4153
  }
4154
+ function removedOptionReason(name, details) {
4155
+ return `${name} passes option(s) this release removed. The migration copies the call across unchanged, so carrying them over would produce a lint module that fails on the next lint run. Update the call, then re-run the migration:\n${details}`;
4156
+ }
4140
4157
  function annotationWarning(line) {
4141
4158
  return {
4142
4159
  kind: "dropped-type-annotation",
@@ -4215,6 +4232,8 @@ function rehouseV3Config(source, filePath) {
4215
4232
  if (!isCallOf(unwrapped, aliases)) return refuse(indirectCallReason(name));
4216
4233
  const reading = readArgument(unwrapped);
4217
4234
  if (reading.optionKeys.includes("preset")) return refuse(presetReason(name));
4235
+ const removed = require_removedOptions.describeRemovedOptions(reading.optionKeys);
4236
+ if (removed !== null) return refuse(removedOptionReason(name, removed));
4218
4237
  return {
4219
4238
  kind: "rehoused",
4220
4239
  rehoused: {