Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit ea6ad60

Browse files
committed
Update vue rules
1 parent 7b9cb74 commit ea6ad60

File tree

7 files changed

+121
-3
lines changed

7 files changed

+121
-3
lines changed

src/rules/vue/block-lang.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { RuleConfig } from '../rule-config';
44
* Option.
55
*/
66
export interface BlockLangOption {
7+
/**
8+
*/
79
[k: string]: {
810
lang?: string | string[];
911
allowNoLang?: boolean;

src/rules/vue/block-tag-newline.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export interface BlockTagNewlineOption {
88
multiline?: 'always' | 'never' | 'consistent' | 'ignore';
99
maxEmptyLines?: number;
1010
blocks?: {
11+
/**
12+
*/
1113
[k: string]: {
1214
singleline?: 'always' | 'never' | 'consistent' | 'ignore';
1315
multiline?: 'always' | 'never' | 'consistent' | 'ignore';

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import type { NewLineBetweenMultiLinePropertyRule } from './new-line-between-mul
5050
import type { NextTickStyleRule } from './next-tick-style';
5151
import type { NoArrowFunctionsInWatchRule } from './no-arrow-functions-in-watch';
5252
import type { NoAsyncInComputedPropertiesRule } from './no-async-in-computed-properties';
53+
import type { NoBareStringsInTemplateRule } from './no-bare-strings-in-template';
5354
import type { NoBooleanDefaultRule } from './no-boolean-default';
5455
import type { NoChildContentRule } from './no-child-content';
5556
import type { NoComputedPropertiesInDataRule } from './no-computed-properties-in-data';
@@ -97,6 +98,7 @@ import type { NoParsingErrorRule } from './no-parsing-error';
9798
import type { NoPotentialComponentOptionTypoRule } from './no-potential-component-option-typo';
9899
import type { NoRefAsOperandRule } from './no-ref-as-operand';
99100
import type { NoRefObjectDestructureRule } from './no-ref-object-destructure';
101+
import type { NoRequiredPropWithDefaultRule } from './no-required-prop-with-default';
100102
import type { NoReservedComponentNamesRule } from './no-reserved-component-names';
101103
import type { NoReservedKeysRule } from './no-reserved-keys';
102104
import type { NoReservedPropsRule } from './no-reserved-props';
@@ -269,6 +271,7 @@ export type VueRules = ArrayBracketNewlineRule &
269271
NextTickStyleRule &
270272
NoArrowFunctionsInWatchRule &
271273
NoAsyncInComputedPropertiesRule &
274+
NoBareStringsInTemplateRule &
272275
NoBooleanDefaultRule &
273276
NoChildContentRule &
274277
NoComputedPropertiesInDataRule &
@@ -316,6 +319,7 @@ export type VueRules = ArrayBracketNewlineRule &
316319
NoPotentialComponentOptionTypoRule &
317320
NoRefAsOperandRule &
318321
NoRefObjectDestructureRule &
322+
NoRequiredPropWithDefaultRule &
319323
NoReservedComponentNamesRule &
320324
NoReservedKeysRule &
321325
NoReservedPropsRule &

src/rules/vue/max-len.d.ts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,44 @@ export interface MaxLenSetting {
2222
/**
2323
* Config.
2424
*/
25-
export type MaxLenConfig = MaxLenSetting | number;
25+
export type MaxLenConfig =
26+
| {
27+
code?: number;
28+
template?: number;
29+
comments?: number;
30+
tabWidth?: number;
31+
ignorePattern?: string;
32+
ignoreComments?: boolean;
33+
ignoreTrailingComments?: boolean;
34+
ignoreUrls?: boolean;
35+
ignoreStrings?: boolean;
36+
ignoreTemplateLiterals?: boolean;
37+
ignoreRegExpLiterals?: boolean;
38+
ignoreHTMLAttributeValues?: boolean;
39+
ignoreHTMLTextContents?: boolean;
40+
}
41+
| number;
2642

2743
/**
2844
* Option.
2945
*/
30-
export type MaxLenOption = MaxLenSetting | number;
46+
export type MaxLenOption =
47+
| {
48+
code?: number;
49+
template?: number;
50+
comments?: number;
51+
tabWidth?: number;
52+
ignorePattern?: string;
53+
ignoreComments?: boolean;
54+
ignoreTrailingComments?: boolean;
55+
ignoreUrls?: boolean;
56+
ignoreStrings?: boolean;
57+
ignoreTemplateLiterals?: boolean;
58+
ignoreRegExpLiterals?: boolean;
59+
ignoreHTMLAttributeValues?: boolean;
60+
ignoreHTMLTextContents?: boolean;
61+
}
62+
| number;
3163

3264
/**
3365
* Options.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface NoBareStringsInTemplateOption {
7+
allowlist?: string[];
8+
attributes?: {
9+
/**
10+
*/
11+
[k: string]: string[];
12+
};
13+
directives?: string[];
14+
}
15+
16+
/**
17+
* Options.
18+
*/
19+
export type NoBareStringsInTemplateOptions = [NoBareStringsInTemplateOption?];
20+
21+
/**
22+
* Disallow the use of bare strings in `<template>`.
23+
*
24+
* @see [no-bare-strings-in-template](https://eslint.vuejs.org/rules/no-bare-strings-in-template.html)
25+
*/
26+
export type NoBareStringsInTemplateRuleConfig =
27+
RuleConfig<NoBareStringsInTemplateOptions>;
28+
29+
/**
30+
* Disallow the use of bare strings in `<template>`.
31+
*
32+
* @see [no-bare-strings-in-template](https://eslint.vuejs.org/rules/no-bare-strings-in-template.html)
33+
*/
34+
export interface NoBareStringsInTemplateRule {
35+
/**
36+
* Disallow the use of bare strings in `<template>`.
37+
*
38+
* @see [no-bare-strings-in-template](https://eslint.vuejs.org/rules/no-bare-strings-in-template.html)
39+
*/
40+
'vue/no-bare-strings-in-template': NoBareStringsInTemplateRuleConfig;
41+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface NoRequiredPropWithDefaultOption {
7+
autofix?: boolean;
8+
}
9+
10+
/**
11+
* Options.
12+
*/
13+
export type NoRequiredPropWithDefaultOptions = [
14+
NoRequiredPropWithDefaultOption?,
15+
];
16+
17+
/**
18+
* Enforce props with default values ​​to be optional.
19+
*
20+
* @see [no-required-prop-with-default](https://eslint.vuejs.org/rules/no-required-prop-with-default.html)
21+
*/
22+
export type NoRequiredPropWithDefaultRuleConfig =
23+
RuleConfig<NoRequiredPropWithDefaultOptions>;
24+
25+
/**
26+
* Enforce props with default values ​​to be optional.
27+
*
28+
* @see [no-required-prop-with-default](https://eslint.vuejs.org/rules/no-required-prop-with-default.html)
29+
*/
30+
export interface NoRequiredPropWithDefaultRule {
31+
/**
32+
* Enforce props with default values ​​to be optional.
33+
*
34+
* @see [no-required-prop-with-default](https://eslint.vuejs.org/rules/no-required-prop-with-default.html)
35+
*/
36+
'vue/no-required-prop-with-default': NoRequiredPropWithDefaultRuleConfig;
37+
}

src/rules/vue/padding-line-between-tags.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { RuleConfig } from '../rule-config';
44
* Option.
55
*/
66
export type PaddingLineBetweenTagsOption = {
7-
blankLine: 'always' | 'never';
7+
blankLine: 'always' | 'never' | 'consistent';
88
prev: string;
99
next: string;
1010
}[];

0 commit comments

Comments
 (0)