oxlint-plugin-vize 0.457.0 → 0.463.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/dist/cli.mjs CHANGED
@@ -1026,6 +1026,38 @@ const read = (file) => {
1026
1026
  };
1027
1027
  const digest$1 = (bytes) => createHash("sha256").update(bytes).digest("hex");
1028
1028
  const same = (left, right) => left == null ? right == null : right != null && left.equals(right);
1029
+ function metadataPath(bytes, file, prefix = "") {
1030
+ const text = new TextDecoder("utf-8", {
1031
+ fatal: true,
1032
+ ignoreBOM: true
1033
+ }).decode(bytes).replace(/\n$/u, "").replace(/\r$/u, "");
1034
+ if (!text.startsWith(prefix) || text.length === prefix.length || /[\r\n\0]/u.test(text)) throw new Error(`invalid Git directory metadata: ${file}`);
1035
+ return text.slice(prefix.length);
1036
+ }
1037
+ function regularDirectory(directory) {
1038
+ const stat = fs.lstatSync(directory);
1039
+ if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error(`Git metadata requires a regular directory: ${directory}`);
1040
+ return fs.realpathSync(directory);
1041
+ }
1042
+ /** Resolve Git's per-worktree marker and shared directory without losing input custody. */
1043
+ function gitDirectory(marker, sources) {
1044
+ let stat;
1045
+ try {
1046
+ stat = fs.lstatSync(marker);
1047
+ } catch (error) {
1048
+ if (error.code === "ENOENT") return null;
1049
+ throw error;
1050
+ }
1051
+ if (stat.isDirectory() && !stat.isSymbolicLink()) return marker;
1052
+ const bytes = read(marker);
1053
+ if (bytes == null) throw new Error(`Git metadata disappeared: ${marker}`);
1054
+ sources.set(marker, bytes);
1055
+ const directory = regularDirectory(path.resolve(path.dirname(marker), metadataPath(bytes, marker, "gitdir: ")));
1056
+ const commonFile = path.join(directory, "commondir");
1057
+ const common = read(commonFile);
1058
+ sources.set(commonFile, common);
1059
+ return common == null ? directory : regularDirectory(path.resolve(directory, metadataPath(common, commonFile)));
1060
+ }
1029
1061
  /** Snapshots prove identity, and do not perform native ignore selection. */
1030
1062
  function captureHtmlCustody(options, candidates) {
1031
1063
  const sources = new Map([[options.rootJson, Buffer.from(options.rootBytes)]]);
@@ -1047,8 +1079,9 @@ function captureHtmlCustody(options, candidates) {
1047
1079
  const file = path.join(directory, name);
1048
1080
  sources.set(file, read(file));
1049
1081
  }
1050
- if (fs.existsSync(path.join(directory, ".git"))) {
1051
- const file = path.join(directory, ".git/info/exclude");
1082
+ const git = gitDirectory(path.join(directory, ".git"), sources);
1083
+ if (git != null) {
1084
+ const file = path.join(git, "info/exclude");
1052
1085
  sources.set(file, read(file));
1053
1086
  }
1054
1087
  }
@@ -783,6 +783,25 @@ if (import.meta.vitest) {
783
783
  expect(createVizeRuleConfig({ preset: "happy-path" })).toEqual(configs.recommended);
784
784
  expect(configs.happyPath).toEqual(configs.recommended);
785
785
  });
786
+ it("exposes the exact default warning policy through native metadata", () => {
787
+ const elseFor = "vize/vue/no-use-v-else-with-v-for";
788
+ const deepProps = "vize/script/no-deep-destructure-in-props";
789
+ for (const config of [
790
+ configs.happyPath,
791
+ configs.recommended,
792
+ configs.ecosystem
793
+ ]) {
794
+ expect(config[elseFor]).toBe("warn");
795
+ expect(config[deepProps]).toBeUndefined();
796
+ }
797
+ for (const config of [configs.opinionated, configs.nuxt]) {
798
+ expect(config[elseFor]).toBe("warn");
799
+ expect(config[deepProps]).toBe("warn");
800
+ }
801
+ expect(configs.essential[elseFor]).toBeUndefined();
802
+ expect(configs.essential[deepProps]).toBeUndefined();
803
+ expect(createVizeRuleConfig({ preset: "happy-path" })).toEqual(configs.recommended);
804
+ });
786
805
  it("unions multiple presets", () => {
787
806
  const config = createVizeRuleConfig({ presets: ["happy-path", "ecosystem"] });
788
807
  expect(config["vize/script/valid-define-props"]).toBe("error");
package/dist/eslint.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getPatinaRules, c as isTypeAwareRuleName, d as getRuleOptions, i as formatPatinaMessage, l as createRuleSelection, n as createVizeRuleConfig, o as getActivePreset, r as plugin_default, s as getVizeSettings, t as configs } from "./configs-DY0BrbH2.mjs";
1
+ import { a as getPatinaRules, c as isTypeAwareRuleName, d as getRuleOptions, i as formatPatinaMessage, l as createRuleSelection, n as createVizeRuleConfig, o as getActivePreset, r as plugin_default, s as getVizeSettings, t as configs } from "./configs-BWrI9B41.mjs";
2
2
  import { d as isPatinaFile, m as loadBinding } from "./workaround-CiQUFJw0.mjs";
3
3
  import { definePlugin, defineRule, eslintCompatPlugin } from "@oxlint/plugins";
4
4
  //#region src/eslint-source.ts
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getPatinaRules, n as createVizeRuleConfig, r as plugin_default, t as configs, u as selectVizeRuleConfig } from "./configs-DY0BrbH2.mjs";
1
+ import { a as getPatinaRules, n as createVizeRuleConfig, r as plugin_default, t as configs, u as selectVizeRuleConfig } from "./configs-BWrI9B41.mjs";
2
2
  //#region src/vite-plus.ts
3
3
  /**
4
4
  * Bare specifier Oxlint uses to load this bridge as a JS plugin.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "devDependencies": {
13
13
  "@tsdown/css": "0.22.14",
14
14
  "@types/node": "25.9.2",
15
- "@vizejs/native": "0.457.0",
15
+ "@vizejs/native": "0.463.0",
16
16
  "tsdown": "0.22.14",
17
17
  "typescript": "6.0.3",
18
18
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.24",
@@ -53,14 +53,14 @@
53
53
  },
54
54
  "name": "oxlint-plugin-vize",
55
55
  "optionalDependencies": {
56
- "@vizejs/native-darwin-arm64": "0.457.0",
57
- "@vizejs/native-darwin-x64": "0.457.0",
58
- "@vizejs/native-linux-arm64-gnu": "0.457.0",
59
- "@vizejs/native-linux-arm64-musl": "0.457.0",
60
- "@vizejs/native-linux-x64-gnu": "0.457.0",
61
- "@vizejs/native-linux-x64-musl": "0.457.0",
62
- "@vizejs/native-win32-arm64-msvc": "0.457.0",
63
- "@vizejs/native-win32-x64-msvc": "0.457.0"
56
+ "@vizejs/native-darwin-arm64": "0.463.0",
57
+ "@vizejs/native-darwin-x64": "0.463.0",
58
+ "@vizejs/native-linux-arm64-gnu": "0.463.0",
59
+ "@vizejs/native-linux-arm64-musl": "0.463.0",
60
+ "@vizejs/native-linux-x64-gnu": "0.463.0",
61
+ "@vizejs/native-linux-x64-musl": "0.463.0",
62
+ "@vizejs/native-win32-arm64-msvc": "0.463.0",
63
+ "@vizejs/native-win32-x64-msvc": "0.463.0"
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"
@@ -72,7 +72,7 @@
72
72
  },
73
73
  "type": "module",
74
74
  "types": "./dist/index.d.mts",
75
- "version": "0.457.0",
75
+ "version": "0.463.0",
76
76
  "scripts": {
77
77
  "build": "vp pack",
78
78
  "check": "vp check src vite.config.ts",