oxlint-plugin-vize 0.716.0 → 0.718.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 +13 -5
- package/dist/{configs-CasT29H7.d.mts → configs-BR5ECvTV.d.mts} +11 -0
- package/dist/{configs-DcbkSYDG.mjs → configs-DcZgPDfG.mjs} +2 -0
- package/dist/eslint.d.mts +1 -1
- package/dist/eslint.mjs +1 -1
- package/dist/index.d.mts +22 -1
- package/dist/index.mjs +3 -1
- package/package.json +14 -14
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)
|
|
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
|
-
|
|
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))];
|
|
@@ -637,9 +639,6 @@ function createScopedMirror(cwd, config, files) {
|
|
|
637
639
|
function isRecord$1(value) {
|
|
638
640
|
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
639
641
|
}
|
|
640
|
-
function hasPathSelection(value) {
|
|
641
|
-
return value.ignorePatterns != null || value.overrides != null || Array.isArray(value.extends) && value.extends.some((parent) => isRecord$1(parent) && hasPathSelection(parent));
|
|
642
|
-
}
|
|
643
642
|
function strings(value) {
|
|
644
643
|
if (value == null) return [];
|
|
645
644
|
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) throw new Error("Scoped Vue transport requires string-array override patterns.");
|
|
@@ -655,6 +654,15 @@ function toCliPath(file) {
|
|
|
655
654
|
function literalGlob(file) {
|
|
656
655
|
return toCliPath(file).replaceAll(/[\\*?[\]{}]/gu, String.raw`\$&`);
|
|
657
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
|
+
}
|
|
658
666
|
//#endregion
|
|
659
667
|
//#region src/cli/project-checks.ts
|
|
660
668
|
const isRecord = (value) => typeof value === "object" && value != null && !Array.isArray(value);
|
|
@@ -134,17 +134,28 @@ type VSlotStyle = VSlotUniformStyle | {
|
|
|
134
134
|
};
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/configs.d.ts
|
|
137
|
+
/** Severity spellings accepted by Oxlint rule entries. */
|
|
137
138
|
type OxlintRuleSeverity = "error" | "warn" | "off";
|
|
139
|
+
/** One Oxlint rule severity, optionally followed by rule-specific options. */
|
|
138
140
|
type OxlintRuleEntry = OxlintRuleSeverity | [OxlintRuleSeverity, ...unknown[]];
|
|
141
|
+
/** Oxlint rule map keyed by core or plugin-qualified rule id. */
|
|
139
142
|
type OxlintRuleConfig = Record<string, OxlintRuleEntry>;
|
|
143
|
+
/** Named Patina rule bundle accepted by the Oxlint bridge. */
|
|
140
144
|
type VizeRuleConfigPreset = Exclude<PatinaPreset, "incremental"> | "happy-path" | "all";
|
|
145
|
+
/** One rule bundle or an ordered set of bundles whose rules are unioned. */
|
|
141
146
|
type VizeRuleConfigPresetInput = VizeRuleConfigPreset | readonly VizeRuleConfigPreset[];
|
|
147
|
+
/** Options for deriving an Oxlint rule map from Patina's native metadata. */
|
|
142
148
|
interface VizeRuleConfigOptions {
|
|
149
|
+
/** Include unstable rules that require type information. @default false */
|
|
143
150
|
includeTypeAware?: boolean;
|
|
151
|
+
/** Primary rule bundle or bundles. @default "general-recommended" */
|
|
144
152
|
preset?: VizeRuleConfigPresetInput;
|
|
153
|
+
/** Additional rule bundles unioned with `preset`. @default [] */
|
|
145
154
|
presets?: readonly VizeRuleConfigPreset[];
|
|
146
155
|
}
|
|
156
|
+
/** Build an Oxlint rule map from the selected Patina metadata bundles. */
|
|
147
157
|
declare function createVizeRuleConfig(options?: VizeRuleConfigOptions): OxlintRuleConfig;
|
|
158
|
+
/** Ready-to-use rule maps for every supported bridge preset. */
|
|
148
159
|
declare const configs: {
|
|
149
160
|
readonly all: OxlintRuleConfig;
|
|
150
161
|
readonly ecosystem: OxlintRuleConfig;
|
|
@@ -1156,6 +1156,7 @@ var plugin_default = definePlugin({
|
|
|
1156
1156
|
//#endregion
|
|
1157
1157
|
//#region src/configs.ts
|
|
1158
1158
|
const TYPE_AWARE_RULE_PREFIX = "type/";
|
|
1159
|
+
/** Build an Oxlint rule map from the selected Patina metadata bundles. */
|
|
1159
1160
|
function createVizeRuleConfig(options = {}) {
|
|
1160
1161
|
const presets = resolveRuleConfigPresets(options);
|
|
1161
1162
|
const includeTypeAware = options.includeTypeAware ?? false;
|
|
@@ -1167,6 +1168,7 @@ function createVizeRuleConfig(options = {}) {
|
|
|
1167
1168
|
}
|
|
1168
1169
|
return rules;
|
|
1169
1170
|
}
|
|
1171
|
+
/** Ready-to-use rule maps for every supported bridge preset. */
|
|
1170
1172
|
const configs = {
|
|
1171
1173
|
all: createVizeRuleConfig({ preset: "all" }),
|
|
1172
1174
|
ecosystem: createVizeRuleConfig({ preset: "ecosystem" }),
|
package/dist/eslint.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createVizeRuleConfig, s as configs } from "./configs-
|
|
1
|
+
import { c as createVizeRuleConfig, s as configs } from "./configs-BR5ECvTV.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/eslint.d.ts
|
|
4
4
|
/** ESLint rules over the complete source supplied by the configured parser. */
|
package/dist/eslint.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getPatinaRules, d as isTypeAwareRuleName, f as createRuleSelection, i as formatPatinaMessage, l as getActivePreset, m as getRuleOptions, n as createVizeRuleConfig, o as diagnosticsForRule, r as plugin_default, s as indexDiagnosticsByRule, t as configs, u as getVizeSettings } from "./configs-
|
|
1
|
+
import { c as getPatinaRules, d as isTypeAwareRuleName, f as createRuleSelection, i as formatPatinaMessage, l as getActivePreset, m as getRuleOptions, n as createVizeRuleConfig, o as diagnosticsForRule, r as plugin_default, s as indexDiagnosticsByRule, t as configs, u as getVizeSettings } from "./configs-DcZgPDfG.mjs";
|
|
2
2
|
import { d as isPatinaFile, m as loadBinding } from "./workaround-Byh3ja-i.mjs";
|
|
3
3
|
import { definePlugin, defineRule, eslintCompatPlugin } from "@oxlint/plugins";
|
|
4
4
|
//#region src/eslint-source.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as VizeRuleConfigPreset, c as createVizeRuleConfig, d as VizeRuleOptions, i as VizeRuleConfigOptions, l as PatinaPreset, n as OxlintRuleEntry, o as VizeRuleConfigPresetInput, r as OxlintRuleSeverity, s as configs, t as OxlintRuleConfig, u as PatinaSettings } from "./configs-
|
|
1
|
+
import { a as VizeRuleConfigPreset, c as createVizeRuleConfig, d as VizeRuleOptions, i as VizeRuleConfigOptions, l as PatinaPreset, n as OxlintRuleEntry, o as VizeRuleConfigPresetInput, r as OxlintRuleSeverity, s as configs, t as OxlintRuleConfig, u as PatinaSettings } from "./configs-BR5ECvTV.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const _default: import("@oxlint/plugins").Plugin;
|
|
@@ -21,11 +21,15 @@ type VitePlusLintPlugin = "eslint" | "import" | "jest" | "jsdoc" | "jsx-a11y" |
|
|
|
21
21
|
* one preset, while those shapes need exactly the emitted rule map to run.
|
|
22
22
|
*/
|
|
23
23
|
type VizeLintPreset = PatinaPreset | "happy-path" | "all";
|
|
24
|
+
/** One Vize lint preset or an ordered set whose rules are unioned. */
|
|
24
25
|
type VizeLintPresetInput = VizeLintPreset | readonly VizeLintPreset[];
|
|
26
|
+
/** Options for building the Vite+ Oxlint block that loads the Vize bridge. */
|
|
25
27
|
interface VizeLintConfigOptions {
|
|
26
28
|
/**
|
|
27
29
|
* Include Vize's unstable `vize/type/*` rules in the preset rule map. Off by
|
|
28
30
|
* default, matching `createVizeRuleConfig`.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
29
33
|
*/
|
|
30
34
|
includeTypeAware?: boolean;
|
|
31
35
|
/**
|
|
@@ -35,41 +39,55 @@ interface VizeLintConfigOptions {
|
|
|
35
39
|
* would silently drop the diagnostics those plugins produce, so anything passed
|
|
36
40
|
* here is merged rather than replaced. A `create-vue` project, for example,
|
|
37
41
|
* needs `["eslint", "typescript", "unicorn", "oxc"]` carried over.
|
|
42
|
+
*
|
|
43
|
+
* @default []
|
|
38
44
|
*/
|
|
39
45
|
plugins?: readonly VitePlusLintPlugin[];
|
|
40
46
|
/**
|
|
41
47
|
* Rule bundle or bundles to enable. Defaults to `"general-recommended"`, the
|
|
42
48
|
* bridge's own default. `"incremental"` emits no preset rules, so only `rules`
|
|
43
49
|
* run.
|
|
50
|
+
*
|
|
51
|
+
* @default "general-recommended"
|
|
44
52
|
*/
|
|
45
53
|
preset?: VizeLintPresetInput;
|
|
46
54
|
/**
|
|
47
55
|
* Additional rule bundles to enable alongside `preset`. This is equivalent to
|
|
48
56
|
* passing an array to `preset`, but reads better when the base preset is kept
|
|
49
57
|
* separate from project-specific add-ons.
|
|
58
|
+
*
|
|
59
|
+
* @default []
|
|
50
60
|
*/
|
|
51
61
|
presets?: readonly VizeLintPreset[];
|
|
52
62
|
/**
|
|
53
63
|
* Extra Oxlint rules merged after the preset rules. Core Oxlint rule ids pass
|
|
54
64
|
* through untouched; `vize/*` ids are validated against the rules the native
|
|
55
65
|
* bridge registers and, for a single gated preset, against the resolved preset.
|
|
66
|
+
*
|
|
67
|
+
* @default {}
|
|
56
68
|
*/
|
|
57
69
|
rules?: OxlintRuleConfig;
|
|
58
70
|
/**
|
|
59
71
|
* CLI-compatible `vue.linter.ruleOptions`. Options are attached to rules
|
|
60
72
|
* already enabled by a preset or by `rules`; options never enable a rule.
|
|
73
|
+
*
|
|
74
|
+
* @default {}
|
|
61
75
|
*/
|
|
62
76
|
ruleOptions?: VizeRuleOptions;
|
|
63
77
|
/**
|
|
64
78
|
* Patina runtime settings forwarded through `settings.vize`. `preset` and
|
|
65
79
|
* `rules` are derived from the selected presets and final rule map,
|
|
66
80
|
* so the rule map and the bridge's runtime gate can never disagree.
|
|
81
|
+
*
|
|
82
|
+
* @default {}
|
|
67
83
|
*/
|
|
68
84
|
settings?: Omit<PatinaSettings, "preset" | "rules">;
|
|
69
85
|
}
|
|
86
|
+
/** Runtime settings object emitted under the Oxlint `settings` key. */
|
|
70
87
|
interface VizeLintConfigSettings extends Record<string, unknown> {
|
|
71
88
|
vize: PatinaSettings;
|
|
72
89
|
}
|
|
90
|
+
/** Complete Vite+ lint configuration emitted by the Vize bridge. */
|
|
73
91
|
interface VizeLintConfig extends Record<string, unknown> {
|
|
74
92
|
jsPlugins: string[];
|
|
75
93
|
plugins: VitePlusLintPlugin[];
|
|
@@ -113,6 +131,7 @@ interface VizeLintConfig extends Record<string, unknown> {
|
|
|
113
131
|
declare function createVizeLintConfig(options?: VizeLintConfigOptions): VizeLintConfig;
|
|
114
132
|
//#endregion
|
|
115
133
|
//#region src/vite-plus-flat-config.d.ts
|
|
134
|
+
/** One composable Oxlint Flat Config fragment understood by the Vize bridge. */
|
|
116
135
|
interface VizeLintConfigFragment extends Record<string, unknown> {
|
|
117
136
|
extends?: readonly (VizeLintConfigFragment | VizeLintFlatConfig)[];
|
|
118
137
|
ignorePatterns?: readonly string[];
|
|
@@ -124,6 +143,7 @@ interface VizeLintConfigFragment extends Record<string, unknown> {
|
|
|
124
143
|
vize?: PatinaSettings | Record<string, unknown>;
|
|
125
144
|
};
|
|
126
145
|
}
|
|
146
|
+
/** Immutable sequence of Vize-aware Oxlint Flat Config fragments. */
|
|
127
147
|
type VizeLintFlatConfig = readonly VizeLintConfigFragment[];
|
|
128
148
|
/**
|
|
129
149
|
* Returns spreadable Oxlint/Vite+ config fragments for Flat Config style use.
|
|
@@ -133,6 +153,7 @@ type VizeLintFlatConfig = readonly VizeLintConfigFragment[];
|
|
|
133
153
|
* suppressing rules emitted by another fragment.
|
|
134
154
|
*/
|
|
135
155
|
declare function createVizeLintFlatConfig(options?: VizeLintConfigOptions): VizeLintFlatConfig;
|
|
156
|
+
/** Ready-to-spread Flat Config sequences for every supported bridge preset. */
|
|
136
157
|
declare const flatConfigs: {
|
|
137
158
|
all: VizeLintFlatConfig;
|
|
138
159
|
ecosystem: VizeLintFlatConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getPatinaRules, n as createVizeRuleConfig, p as selectVizeRuleConfig, r as plugin_default, t as configs } from "./configs-
|
|
1
|
+
import { c as getPatinaRules, n as createVizeRuleConfig, p as selectVizeRuleConfig, r as plugin_default, t as configs } from "./configs-DcZgPDfG.mjs";
|
|
2
2
|
//#region src/vite-plus.ts
|
|
3
3
|
/**
|
|
4
4
|
* Bare specifier Oxlint uses to load this bridge as a JS plugin.
|
|
@@ -46,6 +46,7 @@ const DEFAULT_VIZE_LINT_PRESET = "general-recommended";
|
|
|
46
46
|
function createVizeLintConfig(options = {}) {
|
|
47
47
|
return buildVizeLintConfig(options, { forceIncrementalRuntime: false });
|
|
48
48
|
}
|
|
49
|
+
/** Build the bridge config while choosing whether composed fragments force incremental gating. */
|
|
49
50
|
function buildVizeLintConfig(options, buildOptions) {
|
|
50
51
|
const presets = resolveLintPresets(options);
|
|
51
52
|
const runtimePreset = buildOptions.forceIncrementalRuntime ? "incremental" : toRuntimePreset(presets);
|
|
@@ -143,6 +144,7 @@ function pluralizeIds(ids) {
|
|
|
143
144
|
function createVizeLintFlatConfig(options = {}) {
|
|
144
145
|
return [buildVizeLintConfig(options, { forceIncrementalRuntime: true })];
|
|
145
146
|
}
|
|
147
|
+
/** Ready-to-spread Flat Config sequences for every supported bridge preset. */
|
|
146
148
|
const flatConfigs = {
|
|
147
149
|
all: createVizeLintFlatConfig({ preset: "all" }),
|
|
148
150
|
ecosystem: createVizeLintFlatConfig({ preset: "ecosystem" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-vize",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.718.0",
|
|
4
4
|
"description": "Oxlint JS plugin bridge for Vize Patina",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lint",
|
|
@@ -50,27 +50,27 @@
|
|
|
50
50
|
"@nuxt/eslint-config": "1.16.0",
|
|
51
51
|
"@tsdown/css": "0.22.14",
|
|
52
52
|
"@types/node": "25.9.2",
|
|
53
|
-
"@typescript-eslint/parser": "8.
|
|
54
|
-
"@vizejs/native": "0.
|
|
53
|
+
"@typescript-eslint/parser": "8.72.1",
|
|
54
|
+
"@vizejs/native": "0.718.0",
|
|
55
55
|
"ajv": "8.20.0",
|
|
56
|
-
"eslint": "10.
|
|
57
|
-
"eslint-plugin-vue": "10.
|
|
56
|
+
"eslint": "10.14.0",
|
|
57
|
+
"eslint-plugin-vue": "10.12.0",
|
|
58
58
|
"oxlint": "1.78.0",
|
|
59
59
|
"tsdown": "0.22.14",
|
|
60
60
|
"typescript": "6.0.3",
|
|
61
61
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.24",
|
|
62
62
|
"vite-plus": "0.1.24",
|
|
63
|
-
"vue-eslint-parser": "10.4.
|
|
63
|
+
"vue-eslint-parser": "10.4.2"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
|
-
"@vizejs/native-darwin-arm64": "0.
|
|
67
|
-
"@vizejs/native-darwin-x64": "0.
|
|
68
|
-
"@vizejs/native-linux-arm64-gnu": "0.
|
|
69
|
-
"@vizejs/native-linux-arm64-musl": "0.
|
|
70
|
-
"@vizejs/native-linux-x64-gnu": "0.
|
|
71
|
-
"@vizejs/native-linux-x64-musl": "0.
|
|
72
|
-
"@vizejs/native-win32-arm64-msvc": "0.
|
|
73
|
-
"@vizejs/native-win32-x64-msvc": "0.
|
|
66
|
+
"@vizejs/native-darwin-arm64": "0.718.0",
|
|
67
|
+
"@vizejs/native-darwin-x64": "0.718.0",
|
|
68
|
+
"@vizejs/native-linux-arm64-gnu": "0.718.0",
|
|
69
|
+
"@vizejs/native-linux-arm64-musl": "0.718.0",
|
|
70
|
+
"@vizejs/native-linux-x64-gnu": "0.718.0",
|
|
71
|
+
"@vizejs/native-linux-x64-musl": "0.718.0",
|
|
72
|
+
"@vizejs/native-win32-arm64-msvc": "0.718.0",
|
|
73
|
+
"@vizejs/native-win32-x64-msvc": "0.718.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": "^22 || >= 24"
|