oxlint-plugin-vize 0.748.0 → 0.750.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.
@@ -1,3 +1,27 @@
1
+ //#region src/block-limit-options.d.ts
2
+ interface BlockLangBlockOptions {
3
+ lang?: string | string[];
4
+ allowNoLang?: boolean;
5
+ required?: boolean;
6
+ }
7
+ interface BlockLangRuleOptions {
8
+ script?: BlockLangBlockOptions;
9
+ template?: BlockLangBlockOptions;
10
+ style?: BlockLangBlockOptions;
11
+ }
12
+ interface MaxLinesObjectOptions {
13
+ max?: number;
14
+ skipComments?: boolean;
15
+ skipBlankLines?: boolean;
16
+ }
17
+ type MaxLinesRuleOptions = number | MaxLinesObjectOptions;
18
+ interface MaxLinesPerBlockRuleOptions {
19
+ style?: number;
20
+ template?: number;
21
+ script?: number;
22
+ skipBlankLines?: boolean;
23
+ }
24
+ //#endregion
1
25
  //#region src/v-on-event-options.d.ts
2
26
  interface VOnEventHyphenationOptions {
3
27
  style?: HyphenationStyle;
@@ -123,6 +147,9 @@ interface VizeRuleOptions {
123
147
  tier?: string;
124
148
  }>;
125
149
  };
150
+ "vue/block-lang"?: BlockLangRuleOptions;
151
+ "max-lines"?: MaxLinesRuleOptions;
152
+ "vue/max-lines-per-block"?: MaxLinesPerBlockRuleOptions;
126
153
  }
127
154
  type ComponentNameInTemplateCasingOption = "PascalCase" | "kebab-case";
128
155
  type CustomEventNameCasingOption = "lowercase" | "camelCase" | "kebab-case";
@@ -233,6 +233,148 @@ function componentNameCasingSchema() {
233
233
  };
234
234
  }
235
235
  //#endregion
236
+ //#region src/block-limit-options.ts
237
+ const BLOCK_KEYS = [
238
+ "script",
239
+ "template",
240
+ "style"
241
+ ];
242
+ const BLOCK_FIELD_KEYS = [
243
+ "lang",
244
+ "allowNoLang",
245
+ "required"
246
+ ];
247
+ function isWholeNumber(value) {
248
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
249
+ }
250
+ function isLangName(value) {
251
+ return isString(value) && value.length > 0;
252
+ }
253
+ function isLangList(value) {
254
+ return isLangName(value) || Array.isArray(value) && value.length > 0 && value.every(isLangName);
255
+ }
256
+ function isBlockOptions(value) {
257
+ if (!isRecord(value) || !hasOnlyKeys(value, BLOCK_FIELD_KEYS)) return false;
258
+ return (value.lang === void 0 || isLangList(value.lang)) && optionalBooleanField(value.allowNoLang) && optionalBooleanField(value.required);
259
+ }
260
+ /** eslint-plugin-vue's `vue/block-lang` object, forwarded unchanged. */
261
+ function getBlockLangOptions(options) {
262
+ if (options.length !== 1) return void 0;
263
+ const first = options[0];
264
+ if (!isRecord(first) || !hasOnlyKeys(first, BLOCK_KEYS)) return void 0;
265
+ const blockLang = {};
266
+ for (const key of BLOCK_KEYS) {
267
+ const value = first[key];
268
+ if (value === void 0) continue;
269
+ if (!isBlockOptions(value)) return void 0;
270
+ blockLang[key] = structuredClone(value);
271
+ }
272
+ return { ruleOptions: { "vue/block-lang": blockLang } };
273
+ }
274
+ function blockLangSchema() {
275
+ const block = {
276
+ type: "object",
277
+ properties: {
278
+ lang: { oneOf: [{
279
+ type: "string",
280
+ minLength: 1
281
+ }, {
282
+ type: "array",
283
+ items: {
284
+ type: "string",
285
+ minLength: 1
286
+ },
287
+ minItems: 1
288
+ }] },
289
+ allowNoLang: { type: "boolean" },
290
+ required: { type: "boolean" }
291
+ },
292
+ additionalProperties: false
293
+ };
294
+ return {
295
+ type: "object",
296
+ properties: {
297
+ script: block,
298
+ template: block,
299
+ style: block
300
+ },
301
+ additionalProperties: false
302
+ };
303
+ }
304
+ /** ESLint `max-lines`: a maximum, or `{ max, skipComments, skipBlankLines }`. */
305
+ function getMaxLinesOptions(options) {
306
+ if (options.length !== 1) return void 0;
307
+ const first = options[0];
308
+ if (isWholeNumber(first)) return { ruleOptions: { "max-lines": first } };
309
+ if (isRecord(first) && hasOnlyKeys(first, [
310
+ "max",
311
+ "skipComments",
312
+ "skipBlankLines"
313
+ ]) && (first.max === void 0 || isWholeNumber(first.max)) && optionalBooleanField(first.skipComments) && optionalBooleanField(first.skipBlankLines)) {
314
+ const maxLines = {};
315
+ if (isWholeNumber(first.max)) maxLines.max = first.max;
316
+ if (first.skipComments === true) maxLines.skipComments = true;
317
+ if (first.skipComments === false) maxLines.skipComments = false;
318
+ if (first.skipBlankLines === true) maxLines.skipBlankLines = true;
319
+ if (first.skipBlankLines === false) maxLines.skipBlankLines = false;
320
+ return { ruleOptions: { "max-lines": maxLines } };
321
+ }
322
+ }
323
+ function maxLinesSchema() {
324
+ return { oneOf: [{
325
+ type: "integer",
326
+ minimum: 0
327
+ }, {
328
+ type: "object",
329
+ properties: {
330
+ max: {
331
+ type: "integer",
332
+ minimum: 0
333
+ },
334
+ skipComments: { type: "boolean" },
335
+ skipBlankLines: { type: "boolean" }
336
+ },
337
+ additionalProperties: false
338
+ }] };
339
+ }
340
+ /** `vue/max-lines-per-block` limits, matching the native option object. */
341
+ function getMaxLinesPerBlockOptions(options) {
342
+ if (options.length !== 1) return void 0;
343
+ const first = options[0];
344
+ if (!isRecord(first) || !hasOnlyKeys(first, [
345
+ "style",
346
+ "template",
347
+ "script",
348
+ "skipBlankLines"
349
+ ]) || ![
350
+ "style",
351
+ "template",
352
+ "script"
353
+ ].every((key) => first[key] === void 0 || isWholeNumber(first[key])) || !optionalBooleanField(first.skipBlankLines)) return;
354
+ const perBlock = {};
355
+ if (isWholeNumber(first.style)) perBlock.style = first.style;
356
+ if (isWholeNumber(first.template)) perBlock.template = first.template;
357
+ if (isWholeNumber(first.script)) perBlock.script = first.script;
358
+ if (typeof first.skipBlankLines === "boolean") perBlock.skipBlankLines = first.skipBlankLines;
359
+ return { ruleOptions: { "vue/max-lines-per-block": perBlock } };
360
+ }
361
+ function maxLinesPerBlockSchema() {
362
+ const limit = {
363
+ type: "integer",
364
+ minimum: 0
365
+ };
366
+ return {
367
+ type: "object",
368
+ properties: {
369
+ style: limit,
370
+ template: limit,
371
+ script: limit,
372
+ skipBlankLines: { type: "boolean" }
373
+ },
374
+ additionalProperties: false
375
+ };
376
+ }
377
+ //#endregion
236
378
  //#region src/rule-options.ts
237
379
  function getRuleOptions(ruleName, options) {
238
380
  const firstOption = options[0];
@@ -279,6 +421,9 @@ function getRuleOptions(ruleName, options) {
279
421
  if (isVBindStyle(firstOption)) return { ruleOptions: { "vue/v-bind-style": firstOption } };
280
422
  break;
281
423
  case "vue/attribute-hyphenation": return getAttributeHyphenationOptions(options);
424
+ case "vue/block-lang": return getBlockLangOptions(options);
425
+ case "max-lines": return getMaxLinesOptions(options);
426
+ case "vue/max-lines-per-block": return getMaxLinesPerBlockOptions(options);
282
427
  case "vue/no-restricted-syntax":
283
428
  if (options.every(isSupportedRestrictedSyntaxEntry)) return { ruleOptions: { "vue/no-restricted-syntax": { selectors: [...options] } } };
284
429
  break;
@@ -1080,6 +1225,9 @@ function ruleOptionsSchema(ruleName) {
1080
1225
  case "vue/valid-v-on": return [objectSchema({ modifiers: stringArraySchema() })];
1081
1226
  case "vue/valid-v-slot": return [objectSchema({ allowModifiers: { type: "boolean" } })];
1082
1227
  case "musea/prefer-design-tokens": return [designTokensSchema()];
1228
+ case "vue/block-lang": return [blockLangSchema()];
1229
+ case "max-lines": return [maxLinesSchema()];
1230
+ case "vue/max-lines-per-block": return [maxLinesPerBlockSchema()];
1083
1231
  default: return [];
1084
1232
  }
1085
1233
  }
package/dist/eslint.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as createVizeRuleConfig, s as configs } from "./configs-10eAJ8Lb.mjs";
1
+ import { c as createVizeRuleConfig, s as configs } from "./configs-B08naiI0.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-CFIDpbq9.mjs";
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-DY5MIYh4.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-10eAJ8Lb.mjs";
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-B08naiI0.mjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const _default: import("@oxlint/plugins").Plugin;
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-CFIDpbq9.mjs";
1
+ import { c as getPatinaRules, n as createVizeRuleConfig, p as selectVizeRuleConfig, r as plugin_default, t as configs } from "./configs-DY5MIYh4.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-vize",
3
- "version": "0.748.0",
3
+ "version": "0.750.0",
4
4
  "description": "Oxlint JS plugin bridge for Vize Patina",
5
5
  "keywords": [
6
6
  "lint",
@@ -51,7 +51,7 @@
51
51
  "@tsdown/css": "0.22.14",
52
52
  "@types/node": "25.9.2",
53
53
  "@typescript-eslint/parser": "8.72.1",
54
- "@vizejs/native": "0.748.0",
54
+ "@vizejs/native": "0.750.0",
55
55
  "ajv": "8.20.0",
56
56
  "eslint": "10.14.0",
57
57
  "eslint-plugin-vue": "10.12.0",
@@ -63,14 +63,14 @@
63
63
  "vue-eslint-parser": "10.4.2"
64
64
  },
65
65
  "optionalDependencies": {
66
- "@vizejs/native-darwin-arm64": "0.748.0",
67
- "@vizejs/native-darwin-x64": "0.748.0",
68
- "@vizejs/native-linux-arm64-gnu": "0.748.0",
69
- "@vizejs/native-linux-arm64-musl": "0.748.0",
70
- "@vizejs/native-linux-x64-gnu": "0.748.0",
71
- "@vizejs/native-linux-x64-musl": "0.748.0",
72
- "@vizejs/native-win32-arm64-msvc": "0.748.0",
73
- "@vizejs/native-win32-x64-msvc": "0.748.0"
66
+ "@vizejs/native-darwin-arm64": "0.750.0",
67
+ "@vizejs/native-darwin-x64": "0.750.0",
68
+ "@vizejs/native-linux-arm64-gnu": "0.750.0",
69
+ "@vizejs/native-linux-arm64-musl": "0.750.0",
70
+ "@vizejs/native-linux-x64-gnu": "0.750.0",
71
+ "@vizejs/native-linux-x64-musl": "0.750.0",
72
+ "@vizejs/native-win32-arm64-msvc": "0.750.0",
73
+ "@vizejs/native-win32-x64-msvc": "0.750.0"
74
74
  },
75
75
  "engines": {
76
76
  "node": "^22 || >= 24"
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "scripts": {
85
85
  "build": "vp pack",
86
- "test": "vp pack && vp test run src/file-state.test.ts src/batched-rules.test.ts src/script-safe-source.test.ts src/active-rule-collection.test.ts src/v-on-event-options.test.ts src/v-on-event-tuple-options.test.ts src/prop-name-options.test.ts src/component-name-options.test.ts && node src/test.ts && node src/script-location.test.ts && node src/casing-options.test.ts && node src/router-globals.test.ts && node src/template-style-fixes.test.mjs && node src/html-binding.test.mjs && node --test src/component-name-source.test.ts src/eslint-source.test.ts src/attribute-options.test.ts src/attribute-ignore-tags.test.ts src/cli/files-dotfiles.test.ts src/cli/oxlint.test.ts src/cli/report-format.test.ts src/cli/type-aware-vue.test.ts && node src/eslint-acceptance.test.mjs && node src/v-on-event-autofix-host.test.ts && node src/v-on-event-tuple-eslint.test.ts && node src/attribute-eslint.test.ts && node src/prop-name-eslint.test.ts && node src/component-name-eslint.test.ts && node src/attribute-ignore-tags-eslint.test.ts && node src/attribute-ignore-tags-oxlint.test.ts",
86
+ "test": "vp pack && vp test run src/file-state.test.ts src/batched-rules.test.ts src/script-safe-source.test.ts src/active-rule-collection.test.ts src/v-on-event-options.test.ts src/v-on-event-tuple-options.test.ts src/prop-name-options.test.ts src/component-name-options.test.ts src/block-limit-options.test.ts && node src/test.ts && node src/script-location.test.ts && node src/casing-options.test.ts && node src/router-globals.test.ts && node src/template-style-fixes.test.mjs && node src/html-binding.test.mjs && node --test src/component-name-source.test.ts src/eslint-source.test.ts src/attribute-options.test.ts src/attribute-ignore-tags.test.ts src/cli/files-dotfiles.test.ts src/cli/oxlint.test.ts src/cli/report-format.test.ts src/cli/type-aware-vue.test.ts && node src/eslint-acceptance.test.mjs && node src/v-on-event-autofix-host.test.ts && node src/v-on-event-tuple-eslint.test.ts && node src/attribute-eslint.test.ts && node src/prop-name-eslint.test.ts && node src/component-name-eslint.test.ts && node src/attribute-ignore-tags-eslint.test.ts && node src/attribute-ignore-tags-oxlint.test.ts",
87
87
  "check": "vp check src vite.config.ts",
88
88
  "check:fix": "vp check --fix src vite.config.ts",
89
89
  "fmt": "vp fmt --write src vite.config.ts"