oxlint-plugin-vize 0.310.0 → 0.314.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
@@ -1,4 +1,4 @@
1
- import { a as isStandaloneHtmlFile, i as hasVueLikeExtension, n as hasScriptLikeBlock, t as appendScriptlessWorkaround } from "./workaround-RlqLB_zL.mjs";
1
+ import { i as hasVueLikeExtension, n as hasScriptLikeBlock, s as isStandaloneHtmlFile, t as appendScriptlessWorkaround } from "./workaround-DZNVTi7P.mjs";
2
2
  import { spawn } from "node:child_process";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as extractSfcBlocks, l as formatBlockLabel, o as isVueLikeFile, r as resolveWorkaroundSource, s as compareLineColumn, u as getDiagnosticBlock } from "./workaround-RlqLB_zL.mjs";
1
+ import { a as isPatinaFile, c as compareLineColumn, d as getDiagnosticBlock, l as extractSfcBlocks, o as isScriptLikeFile, r as resolveWorkaroundSource, u as formatBlockLabel } from "./workaround-DZNVTi7P.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { definePlugin, defineRule } from "@oxlint/plugins";
4
4
  import { spawnSync } from "node:child_process";
@@ -325,7 +325,7 @@ function getFileState(context) {
325
325
  filename: resolvedSource.filename,
326
326
  source: resolvedSource.source,
327
327
  extractedScript: context.sourceCode.text,
328
- usesOriginalLocations: resolvedSource.usesOriginalLocations,
328
+ usesOriginalLocations: resolvedSource.usesOriginalLocations || isScriptLikeFile(resolvedSource.filename),
329
329
  reportedRules: /* @__PURE__ */ new Set(),
330
330
  sfcBlocks: void 0,
331
331
  scriptMap: void 0,
@@ -533,7 +533,7 @@ function createPatinaRule(ruleMeta) {
533
533
  },
534
534
  createOnce(context) {
535
535
  return { Program() {
536
- if (!isVueLikeFile(context.filename)) return;
536
+ if (!isPatinaFile(context.filename)) return;
537
537
  const settings = getVizeSettings(context);
538
538
  const activePreset = getActivePreset(settings);
539
539
  if (ruleMeta.presets.length > 0 && !isIncrementalPreset(settings) && !ruleMeta.presets.includes(activePreset)) return;
@@ -612,6 +612,21 @@ if (import.meta.vitest) {
612
612
  expect(configs.nuxt["vize/script/no-options-api"]).toBeUndefined();
613
613
  expect(configs.opinionated["vize/script/no-options-api"]).toBe("error");
614
614
  });
615
+ it("enables Nuxt framework rules only in the Nuxt and all presets", () => {
616
+ for (const ruleName of [
617
+ "prefer-import-meta",
618
+ "no-page-meta-runtime-values",
619
+ "no-nuxt-config-test-key",
620
+ "nuxt-config-keys-order"
621
+ ]) {
622
+ const ruleId = `vize/nuxt/${ruleName}`;
623
+ expect(configs.nuxt[ruleId]).toBe("error");
624
+ expect(configs.all[ruleId]).toBe("error");
625
+ expect(configs.ecosystem[ruleId]).toBeUndefined();
626
+ expect(configs.opinionated[ruleId]).toBeUndefined();
627
+ expect(configs.recommended[ruleId]).toBeUndefined();
628
+ }
629
+ });
615
630
  it("keeps ecosystem rules out of non-ecosystem presets until explicitly selected", () => {
616
631
  expect(configs.recommended["vize/ecosystem/router-link-require-to"]).toBeUndefined();
617
632
  expect(configs.nuxt["vize/ecosystem/nuxt-prefer-nuxt-link"]).toBeUndefined();
@@ -78,6 +78,12 @@ function resolveBlockKind(tagName, openTag) {
78
78
  function isVueLikeFile(filename) {
79
79
  return hasVueLikeExtension(filename);
80
80
  }
81
+ function isPatinaFile(filename) {
82
+ return isVueLikeFile(filename) || isScriptLikeFile(filename);
83
+ }
84
+ function isScriptLikeFile(filename) {
85
+ return /\.(?:[cm]?[jt]sx?)$/u.test(filename);
86
+ }
81
87
  function hasVueLikeExtension(filename) {
82
88
  return filename.endsWith(".vue") || filename.endsWith(".html") || filename.endsWith(".htm");
83
89
  }
@@ -190,4 +196,4 @@ if (import.meta.vitest) {
190
196
  });
191
197
  }
192
198
  //#endregion
193
- export { isStandaloneHtmlFile as a, extractSfcBlocks as c, hasVueLikeExtension as i, formatBlockLabel as l, hasScriptLikeBlock as n, isVueLikeFile as o, resolveWorkaroundSource as r, compareLineColumn as s, appendScriptlessWorkaround as t, getDiagnosticBlock as u };
199
+ export { isPatinaFile as a, compareLineColumn as c, getDiagnosticBlock as d, hasVueLikeExtension as i, extractSfcBlocks as l, hasScriptLikeBlock as n, isScriptLikeFile as o, resolveWorkaroundSource as r, isStandaloneHtmlFile as s, appendScriptlessWorkaround as t, formatBlockLabel as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-vize",
3
- "version": "0.310.0",
3
+ "version": "0.314.0",
4
4
  "description": "Oxlint JS plugin bridge for Vize Patina",
5
5
  "keywords": [
6
6
  "lint",
@@ -44,21 +44,21 @@
44
44
  "devDependencies": {
45
45
  "@tsdown/css": "0.22.0",
46
46
  "@types/node": "25.9.2",
47
- "@vizejs/native": "0.310.0",
47
+ "@vizejs/native": "0.314.0",
48
48
  "tsdown": "0.22.0",
49
49
  "typescript": "6.0.3",
50
50
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.21",
51
51
  "vite-plus": "0.1.21"
52
52
  },
53
53
  "optionalDependencies": {
54
- "@vizejs/native-darwin-arm64": "0.310.0",
55
- "@vizejs/native-darwin-x64": "0.310.0",
56
- "@vizejs/native-linux-arm64-gnu": "0.310.0",
57
- "@vizejs/native-linux-arm64-musl": "0.310.0",
58
- "@vizejs/native-linux-x64-gnu": "0.310.0",
59
- "@vizejs/native-linux-x64-musl": "0.310.0",
60
- "@vizejs/native-win32-arm64-msvc": "0.310.0",
61
- "@vizejs/native-win32-x64-msvc": "0.310.0"
54
+ "@vizejs/native-darwin-arm64": "0.314.0",
55
+ "@vizejs/native-darwin-x64": "0.314.0",
56
+ "@vizejs/native-linux-arm64-gnu": "0.314.0",
57
+ "@vizejs/native-linux-arm64-musl": "0.314.0",
58
+ "@vizejs/native-linux-x64-gnu": "0.314.0",
59
+ "@vizejs/native-linux-x64-musl": "0.314.0",
60
+ "@vizejs/native-win32-arm64-msvc": "0.314.0",
61
+ "@vizejs/native-win32-x64-msvc": "0.314.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": "^22 || >= 24"