oxlint-plugin-vize 0.114.0 → 0.116.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/README.md +5 -4
- package/dist/cli.mjs +2 -2
- package/dist/index.d.mts +3 -1
- package/dist/index.mjs +24 -7
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ This package lets Oxlint execute Patina through Vize's native binding while stil
|
|
|
12
12
|
|
|
13
13
|
- Runs Vize Patina rules inside Oxlint as `vize/*` diagnostics, so Vue-specific findings can live beside Oxlint core rules in one command.
|
|
14
14
|
- Keeps Oxlint's existing rules and built-in `vue` plugin active. The bridge adds Vize rules; it does not replace `eqeqeq`, `no-console`, or your existing `vue/*` setup.
|
|
15
|
-
- Ships preset rule maps for JS/TS Oxlint configs: `configs.recommended`, `configs.essential`, `configs.opinionated`, `configs.nuxt`, `configs.all`, and type-aware opt-in variants.
|
|
15
|
+
- Ships preset rule maps for JS/TS Oxlint configs: `configs.recommended`, `configs.essential`, `configs.ecosystem`, `configs.opinionated`, `configs.nuxt`, `configs.all`, and type-aware opt-in variants.
|
|
16
16
|
- Supports runtime settings through `settings.vize`, including `locale`, `preset`, and `helpLevel`.
|
|
17
17
|
- Provides the `oxlint-vize` CLI wrapper, which runs Oxlint with a scriptless-SFC workaround and rewrites temporary paths back to the original `.vue` files.
|
|
18
18
|
- Resolves Vize native bindings through platform-specific optional dependencies, so published installs do not need a separate `@vizejs/native` package.
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
};
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
`configs.recommended`, `configs.essential`, `configs.opinionated`, `configs.nuxt`, and `configs.all` intentionally skip Vize's unstable type-aware rules for now. If you explicitly want those experimental rules too, use `configs.recommendedWithTypeAware`, `configs.opinionatedWithTypeAware`, or `createVizeRuleConfig({ includeTypeAware: true, preset: ... })`.
|
|
84
|
+
`configs.recommended`, `configs.essential`, `configs.ecosystem`, `configs.opinionated`, `configs.nuxt`, and `configs.all` intentionally skip Vize's unstable type-aware rules for now. If you explicitly want those experimental rules too, use `configs.recommendedWithTypeAware`, `configs.ecosystemWithTypeAware`, `configs.opinionatedWithTypeAware`, or `createVizeRuleConfig({ includeTypeAware: true, preset: ... })`.
|
|
85
85
|
|
|
86
86
|
You can pass Patina settings through `settings.vize`:
|
|
87
87
|
|
|
@@ -97,12 +97,13 @@ You can pass Patina settings through `settings.vize`:
|
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
- `preset` accepts `"general-recommended"`, `"essential"`, `"incremental"`, `"opinionated"`, or `"nuxt"`.
|
|
100
|
+
- `preset` accepts `"general-recommended"`, `"essential"`, `"ecosystem"`, `"incremental"`, `"opinionated"`, or `"nuxt"`.
|
|
101
101
|
- `preset` defaults to `"general-recommended"`.
|
|
102
102
|
- Bundle presets keep out-of-bundle rules quiet even if they are still listed in `rules`.
|
|
103
103
|
- `"incremental"` skips bundle gating and runs only the Vize rules you explicitly configure in Oxlint.
|
|
104
|
+
- `"ecosystem"` enables Vize's Vue Router, Vue I18n, Pinia, Vue Test Utils, Nuxt, and Void Vue rules without taking on the full opinionated preset.
|
|
104
105
|
- `"opinionated"` is the preset that enables Vize's built-in script rules such as `vize/script/no-options-api`.
|
|
105
|
-
- Legacy aliases such as `"GeneralRecommended"`, `"Essential"`, `"Incremental"`, `"Opinionated"`, `"Nuxt"`, and `"happy-path"` are still accepted for compatibility.
|
|
106
|
+
- Legacy aliases such as `"GeneralRecommended"`, `"Essential"`, `"Ecosystem"`, `"Incremental"`, `"Opinionated"`, `"Nuxt"`, and `"happy-path"` are still accepted for compatibility.
|
|
106
107
|
- `helpLevel` accepts `"full"`, `"short"`, or `"none"`.
|
|
107
108
|
- `helpLevel: "full"` only expands the Patina remediation text. It does not restore original-SFC formatter anchors or machine-readable range fidelity.
|
|
108
109
|
- `showHelp` is still accepted for backward compatibility, but `helpLevel` is the preferred setting.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as hasScriptLikeBlock, t as appendScriptlessWorkaround } from "./workaround-57-10EZz.mjs";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import path from "node:path";
|
|
4
2
|
import { spawn } from "node:child_process";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import fs from "node:fs";
|
|
5
5
|
//#region src/cli/args.ts
|
|
6
6
|
const OPTION_NAMES_WITH_VALUES = new Set([
|
|
7
7
|
"-A",
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import * as _$_oxlint_plugins0 from "@oxlint/plugins";
|
|
|
4
4
|
declare const _default: _$_oxlint_plugins0.Plugin;
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/model.d.ts
|
|
7
|
-
type PatinaPreset = "general-recommended" | "essential" | "incremental" | "opinionated" | "nuxt";
|
|
7
|
+
type PatinaPreset = "general-recommended" | "essential" | "ecosystem" | "incremental" | "opinionated" | "nuxt";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/configs.d.ts
|
|
10
10
|
type OxlintRuleSeverity = "error" | "warn";
|
|
@@ -17,6 +17,8 @@ interface VizeRuleConfigOptions {
|
|
|
17
17
|
declare function createVizeRuleConfig(options?: VizeRuleConfigOptions): OxlintRuleConfig;
|
|
18
18
|
declare const configs: {
|
|
19
19
|
readonly all: OxlintRuleConfig;
|
|
20
|
+
readonly ecosystem: OxlintRuleConfig;
|
|
21
|
+
readonly ecosystemWithTypeAware: OxlintRuleConfig;
|
|
20
22
|
readonly essential: OxlintRuleConfig;
|
|
21
23
|
readonly nuxt: OxlintRuleConfig;
|
|
22
24
|
readonly opinionated: OxlintRuleConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { a as extractSfcBlocks, i as compareLineColumn, o as formatBlockLabel, r as resolveWorkaroundSource, s as getDiagnosticBlock } from "./workaround-57-10EZz.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
|
4
|
-
import
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
5
|
import path from "node:path";
|
|
6
|
+
import fs from "node:fs";
|
|
6
7
|
//#region src/native.ts
|
|
7
8
|
const require = createRequire(import.meta.url);
|
|
8
9
|
const FALLBACK_BINDING_PACKAGE = "@vizejs/native";
|
|
@@ -10,11 +11,16 @@ let bindingCache = null;
|
|
|
10
11
|
function isMusl() {
|
|
11
12
|
const report = process.report?.getReport();
|
|
12
13
|
if (typeof report === "object" && report !== null && "header" in report) return !report.header.glibcVersionRuntime;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const result = spawnSync("ldd", ["--version"], {
|
|
15
|
+
encoding: "utf8",
|
|
16
|
+
stdio: [
|
|
17
|
+
"ignore",
|
|
18
|
+
"pipe",
|
|
19
|
+
"pipe"
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
if (result.error) return true;
|
|
23
|
+
return `${result.stdout ?? ""}\n${result.stderr ?? ""}`.includes("musl");
|
|
18
24
|
}
|
|
19
25
|
function getBindingPackageName() {
|
|
20
26
|
const { arch, platform } = process;
|
|
@@ -143,6 +149,8 @@ const PRESET_ALIASES = new Map([
|
|
|
143
149
|
["default", "general-recommended"],
|
|
144
150
|
["recommended", "general-recommended"],
|
|
145
151
|
["essential", "essential"],
|
|
152
|
+
["ecosystem", "ecosystem"],
|
|
153
|
+
["eco", "ecosystem"],
|
|
146
154
|
["incremental", "incremental"],
|
|
147
155
|
["opinionated", "opinionated"],
|
|
148
156
|
["opnionated", "opinionated"],
|
|
@@ -206,6 +214,7 @@ if (import.meta.vitest) {
|
|
|
206
214
|
it("normalizes preset aliases", () => {
|
|
207
215
|
expect(parseVizeSettings({ preset: "recommended" })).toEqual({ preset: "general-recommended" });
|
|
208
216
|
expect(parseVizeSettings({ preset: "incremental" })).toEqual({ preset: "incremental" });
|
|
217
|
+
expect(parseVizeSettings({ preset: "ecosystem" })).toEqual({ preset: "ecosystem" });
|
|
209
218
|
expect(parseVizeSettings({ preset: "strict" })).toEqual({ preset: "opinionated" });
|
|
210
219
|
expect(parseVizeSettings({ preset: "Opnionated" })).toEqual({ preset: "opinionated" });
|
|
211
220
|
});
|
|
@@ -442,6 +451,11 @@ function createVizeRuleConfig(options = {}) {
|
|
|
442
451
|
}
|
|
443
452
|
const configs = {
|
|
444
453
|
all: createVizeRuleConfig({ preset: "all" }),
|
|
454
|
+
ecosystem: createVizeRuleConfig({ preset: "ecosystem" }),
|
|
455
|
+
ecosystemWithTypeAware: createVizeRuleConfig({
|
|
456
|
+
includeTypeAware: true,
|
|
457
|
+
preset: "ecosystem"
|
|
458
|
+
}),
|
|
445
459
|
essential: createVizeRuleConfig({ preset: "essential" }),
|
|
446
460
|
nuxt: createVizeRuleConfig({ preset: "nuxt" }),
|
|
447
461
|
opinionated: createVizeRuleConfig({ preset: "opinionated" }),
|
|
@@ -478,9 +492,12 @@ if (import.meta.vitest) {
|
|
|
478
492
|
expect(configs.opinionated["vize/type/require-typed-props"]).toBeUndefined();
|
|
479
493
|
expect(configs.opinionatedWithTypeAware["vize/type/require-typed-props"]).toBe("warn");
|
|
480
494
|
});
|
|
481
|
-
it("keeps ecosystem rules out of
|
|
495
|
+
it("keeps ecosystem rules out of non-ecosystem presets until explicitly selected", () => {
|
|
482
496
|
expect(configs.recommended["vize/ecosystem/router-link-require-to"]).toBeUndefined();
|
|
483
497
|
expect(configs.nuxt["vize/ecosystem/nuxt-prefer-nuxt-link"]).toBeUndefined();
|
|
498
|
+
expect(configs.ecosystem["vize/ecosystem/router-link-require-to"]).toBe("error");
|
|
499
|
+
expect(configs.ecosystem["vize/ecosystem/vue-i18n-no-missing-key"]).toBe("warn");
|
|
500
|
+
expect(configs.ecosystem["vize/ecosystem/void-link-require-href"]).toBe("error");
|
|
484
501
|
expect(configs.all["vize/ecosystem/router-link-require-to"]).toBe("error");
|
|
485
502
|
});
|
|
486
503
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-vize",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.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.7.0",
|
|
47
|
-
"@vizejs/native": "0.
|
|
47
|
+
"@vizejs/native": "0.116.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.
|
|
55
|
-
"@vizejs/native-darwin-x64": "0.
|
|
56
|
-
"@vizejs/native-linux-arm64-gnu": "0.
|
|
57
|
-
"@vizejs/native-linux-arm64-musl": "0.
|
|
58
|
-
"@vizejs/native-linux-x64-gnu": "0.
|
|
59
|
-
"@vizejs/native-linux-x64-musl": "0.
|
|
60
|
-
"@vizejs/native-win32-arm64-msvc": "0.
|
|
61
|
-
"@vizejs/native-win32-x64-msvc": "0.
|
|
54
|
+
"@vizejs/native-darwin-arm64": "0.116.0",
|
|
55
|
+
"@vizejs/native-darwin-x64": "0.116.0",
|
|
56
|
+
"@vizejs/native-linux-arm64-gnu": "0.116.0",
|
|
57
|
+
"@vizejs/native-linux-arm64-musl": "0.116.0",
|
|
58
|
+
"@vizejs/native-linux-x64-gnu": "0.116.0",
|
|
59
|
+
"@vizejs/native-linux-x64-musl": "0.116.0",
|
|
60
|
+
"@vizejs/native-win32-arm64-msvc": "0.116.0",
|
|
61
|
+
"@vizejs/native-win32-x64-msvc": "0.116.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=24"
|