oxlint-plugin-vize 0.273.1 → 0.274.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 { n as hasScriptLikeBlock, t as appendScriptlessWorkaround } from "./workaround-57-10EZz.mjs";
1
+ import { a as isStandaloneHtmlFile, i as hasVueLikeExtension, n as hasScriptLikeBlock, t as appendScriptlessWorkaround } from "./workaround-BKap0lsB.mjs";
2
2
  import { spawn } from "node:child_process";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs";
@@ -57,12 +57,12 @@ function getLintTargets(argv) {
57
57
  //#endregion
58
58
  //#region src/cli/files.ts
59
59
  const GLOB_PATTERN = /[*?[\]{}]/u;
60
- function collectVueFilesFromTargets(cwd, targets) {
60
+ function collectVueLikeFilesFromTargets(cwd, targets) {
61
61
  const files = /* @__PURE__ */ new Set();
62
- for (const target of targets) for (const file of collectVueFilesFromTarget(cwd, target)) files.add(file);
63
- return [...files];
62
+ for (const target of targets) for (const file of collectVueLikeFilesFromTarget(cwd, target)) files.add(file);
63
+ return [...files].sort();
64
64
  }
65
- function collectVueFilesFromTarget(cwd, target) {
65
+ function collectVueLikeFilesFromTarget(cwd, target) {
66
66
  if (GLOB_PATTERN.test(target)) return fs.globSync(target, {
67
67
  cwd,
68
68
  withFileTypes: false,
@@ -70,15 +70,21 @@ function collectVueFilesFromTarget(cwd, target) {
70
70
  }).map((entry) => path.resolve(cwd, entry)).filter(isSupportedLintFile);
71
71
  const absoluteTarget = path.resolve(cwd, target);
72
72
  if (!fs.existsSync(absoluteTarget)) return [];
73
- if (fs.statSync(absoluteTarget).isDirectory()) return fs.globSync("**/*", {
73
+ const stat = fs.statSync(absoluteTarget);
74
+ if (stat.isDirectory()) return fs.globSync("**/*", {
74
75
  cwd: absoluteTarget,
75
76
  withFileTypes: false,
76
77
  exclude: ["**/node_modules/**", "**/.git/**"]
77
78
  }).map((entry) => path.resolve(absoluteTarget, entry)).filter(isSupportedLintFile);
78
- return isSupportedLintFile(absoluteTarget) ? [absoluteTarget] : [];
79
+ return stat.isFile() && hasVueLikeExtension(absoluteTarget) ? [absoluteTarget] : [];
79
80
  }
80
81
  function isSupportedLintFile(filename) {
81
- return filename.endsWith(".vue") || filename.endsWith(".html") || filename.endsWith(".htm");
82
+ if (!hasVueLikeExtension(filename)) return false;
83
+ try {
84
+ return fs.statSync(filename).isFile();
85
+ } catch {
86
+ return false;
87
+ }
82
88
  }
83
89
  //#endregion
84
90
  //#region src/cli/oxlint.ts
@@ -194,9 +200,6 @@ function isIgnorableRemoveDirError(error) {
194
200
  function toCliPath(filename) {
195
201
  return filename.split(path.sep).join("/");
196
202
  }
197
- function isStandaloneHtmlFile(filename) {
198
- return filename.endsWith(".html") || filename.endsWith(".htm");
199
- }
200
203
  function registerPathReplacementVariants(replacements, cwd, tempFilename, originalFilename) {
201
204
  const relativeTempFilename = path.relative(cwd, tempFilename);
202
205
  const relativeOriginalFilename = getReportedOriginalFilename(cwd, originalFilename);
@@ -221,7 +224,7 @@ function getReportedOriginalFilename(cwd, filename) {
221
224
  async function main() {
222
225
  const cwd = process.cwd();
223
226
  const forwardedArgs = process.argv.slice(2);
224
- const prepared = prepareScriptlessWorkaroundFiles(cwd, collectVueFilesFromTargets(cwd, getLintTargets(forwardedArgs)));
227
+ const prepared = prepareScriptlessWorkaroundFiles(cwd, collectVueLikeFilesFromTargets(cwd, getLintTargets(forwardedArgs)));
225
228
  const args = [
226
229
  resolveOxlintCliEntrypoint(cwd),
227
230
  ...forwardedArgs,
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as extractSfcBlocks, i as compareLineColumn, o as formatBlockLabel, r as resolveWorkaroundSource, s as getDiagnosticBlock } from "./workaround-57-10EZz.mjs";
1
+ import { c as extractSfcBlocks, l as formatBlockLabel, o as isVueLikeFile, r as resolveWorkaroundSource, s as compareLineColumn, u as getDiagnosticBlock } from "./workaround-BKap0lsB.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { definePlugin, defineRule } from "@oxlint/plugins";
4
4
  import { spawnSync } from "node:child_process";
@@ -161,9 +161,6 @@ const PRESET_ALIASES = new Map([
161
161
  ["all", "opinionated"],
162
162
  ["nuxt", "nuxt"]
163
163
  ]);
164
- function isVueLikeFile(filename) {
165
- return filename.endsWith(".vue") || filename.endsWith(".html") || filename.endsWith(".htm");
166
- }
167
164
  function getVizeSettings(context) {
168
165
  const settings = context.settings;
169
166
  return parseVizeSettings(settings.vize ?? settings.patina);
@@ -74,6 +74,17 @@ function resolveBlockKind(tagName, openTag) {
74
74
  return "custom";
75
75
  }
76
76
  //#endregion
77
+ //#region src/file-kinds.ts
78
+ function isVueLikeFile(filename) {
79
+ return hasVueLikeExtension(filename);
80
+ }
81
+ function hasVueLikeExtension(filename) {
82
+ return filename.endsWith(".vue") || filename.endsWith(".html") || filename.endsWith(".htm");
83
+ }
84
+ function isStandaloneHtmlFile(filename) {
85
+ return filename.endsWith(".html") || filename.endsWith(".htm");
86
+ }
87
+ //#endregion
77
88
  //#region src/workaround.ts
78
89
  const SCRIPTLESS_WORKAROUND_OPEN_TAG_PREFIX = `<script setup lang="ts" data-oxlint-plugin-vize-scriptless="`;
79
90
  const SCRIPTLESS_WORKAROUND_CLOSE_TAG = "<\/script>";
@@ -148,4 +159,4 @@ if (import.meta.vitest) {
148
159
  });
149
160
  }
150
161
  //#endregion
151
- export { extractSfcBlocks as a, compareLineColumn as i, hasScriptLikeBlock as n, formatBlockLabel as o, resolveWorkaroundSource as r, getDiagnosticBlock as s, appendScriptlessWorkaround as t };
162
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-vize",
3
- "version": "0.273.1",
3
+ "version": "0.274.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.273.1",
47
+ "@vizejs/native": "0.274.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.273.1",
55
- "@vizejs/native-darwin-x64": "0.273.1",
56
- "@vizejs/native-linux-arm64-gnu": "0.273.1",
57
- "@vizejs/native-linux-arm64-musl": "0.273.1",
58
- "@vizejs/native-linux-x64-gnu": "0.273.1",
59
- "@vizejs/native-linux-x64-musl": "0.273.1",
60
- "@vizejs/native-win32-arm64-msvc": "0.273.1",
61
- "@vizejs/native-win32-x64-msvc": "0.273.1"
54
+ "@vizejs/native-darwin-arm64": "0.274.0",
55
+ "@vizejs/native-darwin-x64": "0.274.0",
56
+ "@vizejs/native-linux-arm64-gnu": "0.274.0",
57
+ "@vizejs/native-linux-arm64-musl": "0.274.0",
58
+ "@vizejs/native-linux-x64-gnu": "0.274.0",
59
+ "@vizejs/native-linux-x64-musl": "0.274.0",
60
+ "@vizejs/native-win32-arm64-msvc": "0.274.0",
61
+ "@vizejs/native-win32-x64-msvc": "0.274.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": "^22 || >= 24"