oxlint-plugin-vize 0.715.0 → 0.717.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +24 -13
  2. package/package.json +10 -10
package/dist/cli.mjs CHANGED
@@ -518,7 +518,7 @@ function validateNestedConfigs(config, files) {
518
518
  }
519
519
  function validateScopedConfig(config, args, platform = process.platform) {
520
520
  const value = config.value;
521
- const hasPortableWindowsRoot = platform === "win32" && path.win32.isAbsolute(config.file) && !hasPathSelection(value);
521
+ const hasPortableWindowsRoot = platform === "win32" && path.win32.isAbsolute(config.file);
522
522
  if (path.parse(config.file).root !== "/" && !hasPortableWindowsRoot) throw new Error("Scoped Vue transport cannot preserve non-POSIX filesystem roots.");
523
523
  if (!config.module && value.extends != null && (!Array.isArray(value.extends) || value.extends.length !== 0)) throw new Error("Scoped Vue transport cannot preserve inherited configs; use a complete JSON config.");
524
524
  if (config.module && value.extends != null) {
@@ -578,11 +578,13 @@ function createScopedMirror(cwd, config, files) {
578
578
  const outside = [...originalsToCopies].filter(([file]) => !contains(configDir, file));
579
579
  const insidePrefix = toCliPath(path.join(root, "inside"));
580
580
  const outsidePrefix = toCliPath(path.join(root, "outside"));
581
+ const configRoot = path.parse(configDir).root;
581
582
  const mapPatterns = (value) => {
582
583
  if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) throw new Error("Scoped Vue transport requires string-array override patterns.");
583
584
  return value.flatMap((pattern) => {
584
585
  if (pattern.startsWith("!")) throw new Error("Scoped Vue transport cannot preserve negated override patterns.");
585
- if (path.isAbsolute(pattern)) return [`${literalGlob(outsidePrefix)}${toCliPath(pattern)}`];
586
+ const absolute = projectAbsoluteOverridePattern(outsidePrefix, pattern, configRoot);
587
+ if (absolute != null) return absolute;
586
588
  const mapped = [`${literalGlob(insidePrefix)}/${pattern}`];
587
589
  if (outside.length === 0) return mapped;
588
590
  if (pattern === "**/*.vue") return [...mapped, ...outside.map(([, copy]) => literalGlob(copy))];
@@ -622,6 +624,7 @@ function createScopedMirror(cwd, config, files) {
622
624
  }
623
625
  if (fs.readFileSync(config.file, "utf8") !== config.bytes) throw new Error("Oxlint config changed while preparing its scoped Vue transport.");
624
626
  return {
627
+ root,
625
628
  sibling,
626
629
  originalsToCopies,
627
630
  pathReplacements,
@@ -636,9 +639,6 @@ function createScopedMirror(cwd, config, files) {
636
639
  function isRecord$1(value) {
637
640
  return typeof value === "object" && value != null && !Array.isArray(value);
638
641
  }
639
- function hasPathSelection(value) {
640
- return value.ignorePatterns != null || value.overrides != null || Array.isArray(value.extends) && value.extends.some((parent) => isRecord$1(parent) && hasPathSelection(parent));
641
- }
642
642
  function strings(value) {
643
643
  if (value == null) return [];
644
644
  if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) throw new Error("Scoped Vue transport requires string-array override patterns.");
@@ -654,12 +654,21 @@ function toCliPath(file) {
654
654
  function literalGlob(file) {
655
655
  return toCliPath(file).replaceAll(/[\\*?[\]{}]/gu, String.raw`\$&`);
656
656
  }
657
+ function projectAbsoluteOverridePattern(outsidePrefix, pattern, configRoot, platform = process.platform) {
658
+ const pathApi = platform === "win32" ? path.win32 : path.posix;
659
+ if (!pathApi.isAbsolute(pattern)) return void 0;
660
+ const toPlatformCliPath = (value) => platform === "win32" ? value.replaceAll("\\", "/") : value;
661
+ const patternRoot = pathApi.parse(pattern).root;
662
+ if (toPlatformCliPath(patternRoot) !== toPlatformCliPath(configRoot)) return [];
663
+ const relative = toPlatformCliPath(pattern.slice(patternRoot.length)).replace(/^\/+/, "");
664
+ return [`${literalGlob(toPlatformCliPath(outsidePrefix))}/${relative}`];
665
+ }
657
666
  //#endregion
658
667
  //#region src/cli/project-checks.ts
659
668
  const isRecord = (value) => typeof value === "object" && value != null && !Array.isArray(value);
660
669
  const isVize = (name) => name.startsWith("vize/");
661
670
  /** Native/project checks retain original paths; only Vize executes on the bridge. */
662
- function splitProjectConfig(config) {
671
+ function splitProjectConfig(config, directoryTransport = false) {
663
672
  const visit = (value, bridge, override = false) => ({
664
673
  ...value,
665
674
  ...Array.isArray(value.extends) ? { extends: value.extends.map((parent) => visit(parent, bridge)) } : {},
@@ -667,6 +676,7 @@ function splitProjectConfig(config) {
667
676
  rules: Object.fromEntries(Object.entries(isRecord(value.rules) ? value.rules : {}).flatMap(([name, setting]) => bridge ? isVize(name) ? [[name, setting]] : [] : [[name, isVize(name) ? "off" : setting]])),
668
677
  ...bridge ? {
669
678
  plugins: [],
679
+ ...directoryTransport && value.ignorePatterns != null ? { ignorePatterns: [] } : {},
670
680
  ...!override ? { categories: Object.fromEntries(["correctness", ...Object.keys(isRecord(value.categories) ? value.categories : {})].map((category) => [category, "off"])) } : {},
671
681
  ...isRecord(value.options) ? { options: {
672
682
  ...value.options,
@@ -699,7 +709,7 @@ function replaceConfigArgs(options, file) {
699
709
  if (!replaced) args.unshift("--config", file);
700
710
  return args;
701
711
  }
702
- function bridgeProjectArgs(options) {
712
+ function bridgeProjectArgs(options, directoryTransport = false) {
703
713
  if (options.some((arg) => [
704
714
  "-A",
705
715
  "-D",
@@ -718,12 +728,12 @@ function bridgeProjectArgs(options) {
718
728
  const args = [];
719
729
  for (let index = 0; index < options.length; index += 1) {
720
730
  const arg = options[index];
721
- if (arg === "--tsconfig") index += 1;
731
+ if (arg === "--tsconfig" || directoryTransport && ["--ignore-path", "--ignore-pattern"].includes(arg)) index += 1;
722
732
  else if (![
723
733
  "--import-plugin",
724
734
  "--type-aware",
725
735
  "--type-check"
726
- ].includes(arg) && !arg.startsWith("--tsconfig=")) args.push(arg);
736
+ ].includes(arg) && (!directoryTransport || !arg.startsWith("--ignore-path=") && !arg.startsWith("--ignore-pattern=")) && !arg.startsWith("--tsconfig=")) args.push(arg);
727
737
  }
728
738
  return args;
729
739
  }
@@ -889,7 +899,7 @@ function mergeProjectOutput(original, bridge, args) {
889
899
  }
890
900
  //#endregion
891
901
  //#region src/cli/scoped-selection.ts
892
- async function prepareScopedSelection(cwd, originalArgs, vueFiles, run, candidates) {
902
+ async function prepareScopedSelection(cwd, originalArgs, vueFiles, run, candidates, platform = process.platform) {
893
903
  if (vueFiles.length === 0) return void 0;
894
904
  if (vueFiles.every(isStandaloneHtmlFile)) return void 0;
895
905
  let config = readScopedConfig(cwd, originalArgs);
@@ -961,9 +971,10 @@ async function prepareScopedSelection(cwd, originalArgs, vueFiles, run, candidat
961
971
  const original = await run(originalArgs);
962
972
  return { result: vueFiles.some(isStandaloneHtmlFile) ? unavailableProjectTransport(original, /* @__PURE__ */ new Error("Scoped Vue transport cannot combine standalone HTML and Vue targets.")) : original };
963
973
  }
964
- const bridgeOptions = bridgeProjectArgs(options);
974
+ const directoryTransport = platform === "win32";
975
+ const bridgeOptions = bridgeProjectArgs(options, directoryTransport);
965
976
  projectOutputFormat(options);
966
- const phases = splitProjectConfig(config);
977
+ const phases = splitProjectConfig(config, directoryTransport);
967
978
  validateScopedConfig(phases.bridge, bridgeOptions);
968
979
  let originalResult;
969
980
  let mirror;
@@ -989,7 +1000,7 @@ async function prepareScopedSelection(cwd, originalArgs, vueFiles, run, candidat
989
1000
  for (let index = 0; index < args.length && args[index] !== "--"; index += 1) if (args[index] === "-c" || args[index] === "--config") args[++index] = mirror.sibling;
990
1001
  else if (args[index].startsWith("--config=")) args[index] = `--config=${mirror.sibling}`;
991
1002
  const projected = selectedVue.map((file) => mirror.originalsToCopies.get(file) ?? file).sort();
992
- args.push(...projected);
1003
+ args.push(...directoryTransport ? [mirror.root] : projected);
993
1004
  const transported = await run([
994
1005
  "--debug",
995
1006
  "files",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-vize",
3
- "version": "0.715.0",
3
+ "version": "0.717.0",
4
4
  "description": "Oxlint JS plugin bridge for Vize Patina",
5
5
  "keywords": [
6
6
  "lint",
@@ -51,7 +51,7 @@
51
51
  "@tsdown/css": "0.22.14",
52
52
  "@types/node": "25.9.2",
53
53
  "@typescript-eslint/parser": "8.65.0",
54
- "@vizejs/native": "0.715.0",
54
+ "@vizejs/native": "0.717.0",
55
55
  "ajv": "8.20.0",
56
56
  "eslint": "10.13.0",
57
57
  "eslint-plugin-vue": "10.9.2",
@@ -63,14 +63,14 @@
63
63
  "vue-eslint-parser": "10.4.1"
64
64
  },
65
65
  "optionalDependencies": {
66
- "@vizejs/native-darwin-arm64": "0.715.0",
67
- "@vizejs/native-darwin-x64": "0.715.0",
68
- "@vizejs/native-linux-arm64-gnu": "0.715.0",
69
- "@vizejs/native-linux-arm64-musl": "0.715.0",
70
- "@vizejs/native-linux-x64-gnu": "0.715.0",
71
- "@vizejs/native-linux-x64-musl": "0.715.0",
72
- "@vizejs/native-win32-arm64-msvc": "0.715.0",
73
- "@vizejs/native-win32-x64-msvc": "0.715.0"
66
+ "@vizejs/native-darwin-arm64": "0.717.0",
67
+ "@vizejs/native-darwin-x64": "0.717.0",
68
+ "@vizejs/native-linux-arm64-gnu": "0.717.0",
69
+ "@vizejs/native-linux-arm64-musl": "0.717.0",
70
+ "@vizejs/native-linux-x64-gnu": "0.717.0",
71
+ "@vizejs/native-linux-x64-musl": "0.717.0",
72
+ "@vizejs/native-win32-arm64-msvc": "0.717.0",
73
+ "@vizejs/native-win32-x64-msvc": "0.717.0"
74
74
  },
75
75
  "engines": {
76
76
  "node": "^22 || >= 24"