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

Commit 152f856

Browse files
committed
Update vue rules
1 parent 13c071e commit 152f856

7 files changed

+111
-4
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface FirstAttributeLinebreakOption {
7+
multiline?: 'below' | 'beside' | 'ignore';
8+
singleline?: 'below' | 'beside' | 'ignore';
9+
}
10+
11+
/**
12+
* Options.
13+
*/
14+
export type FirstAttributeLinebreakOptions = [FirstAttributeLinebreakOption?];
15+
16+
/**
17+
* Enforce the location of first attribute.
18+
*
19+
* @see [first-attribute-linebreak](https://eslint.vuejs.org/rules/first-attribute-linebreak.html)
20+
*/
21+
export type FirstAttributeLinebreakRuleConfig = RuleConfig<FirstAttributeLinebreakOptions>;
22+
23+
/**
24+
* Enforce the location of first attribute.
25+
*
26+
* @see [first-attribute-linebreak](https://eslint.vuejs.org/rules/first-attribute-linebreak.html)
27+
*/
28+
export interface FirstAttributeLinebreakRule {
29+
/**
30+
* Enforce the location of first attribute.
31+
*
32+
* @see [first-attribute-linebreak](https://eslint.vuejs.org/rules/first-attribute-linebreak.html)
33+
*/
34+
'vue/first-attribute-linebreak': FirstAttributeLinebreakRuleConfig;
35+
}

src/rules/vue/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type { DotLocationRule } from './dot-location';
2121
import type { DotNotationRule } from './dot-notation';
2222
import type { EqeqeqRule } from './eqeqeq';
2323
import type { ExperimentalScriptSetupVarsRule } from './experimental-script-setup-vars';
24+
import type { FirstAttributeLinebreakRule } from './first-attribute-linebreak';
2425
import type { FuncCallSpacingRule } from './func-call-spacing';
2526
import type { HtmlButtonHasTypeRule } from './html-button-has-type';
2627
import type { HtmlClosingBracketNewlineRule } from './html-closing-bracket-newline';
@@ -82,6 +83,7 @@ import type { NoInvalidModelKeysRule } from './no-invalid-model-keys';
8283
import type { NoIrregularWhitespaceRule } from './no-irregular-whitespace';
8384
import type { NoLifecycleAfterAwaitRule } from './no-lifecycle-after-await';
8485
import type { NoLoneTemplateRule } from './no-lone-template';
86+
import type { NoLossOfPrecisionRule } from './no-loss-of-precision';
8587
import type { NoMultiSpacesRule } from './no-multi-spaces';
8688
import type { NoMultipleObjectsInClassRule } from './no-multiple-objects-in-class';
8789
import type { NoMultipleSlotArgsRule } from './no-multiple-slot-args';
@@ -92,6 +94,7 @@ import type { NoPotentialComponentOptionTypoRule } from './no-potential-componen
9294
import type { NoRefAsOperandRule } from './no-ref-as-operand';
9395
import type { NoReservedComponentNamesRule } from './no-reserved-component-names';
9496
import type { NoReservedKeysRule } from './no-reserved-keys';
97+
import type { NoReservedPropsRule } from './no-reserved-props';
9598
import type { NoRestrictedBlockRule } from './no-restricted-block';
9699
import type { NoRestrictedCallAfterAwaitRule } from './no-restricted-call-after-await';
97100
import type { NoRestrictedClassRule } from './no-restricted-class';
@@ -221,6 +224,7 @@ export type VueRules = ArrayBracketNewlineRule &
221224
DotNotationRule &
222225
EqeqeqRule &
223226
ExperimentalScriptSetupVarsRule &
227+
FirstAttributeLinebreakRule &
224228
FuncCallSpacingRule &
225229
HtmlButtonHasTypeRule &
226230
HtmlClosingBracketNewlineRule &
@@ -282,6 +286,7 @@ export type VueRules = ArrayBracketNewlineRule &
282286
NoIrregularWhitespaceRule &
283287
NoLifecycleAfterAwaitRule &
284288
NoLoneTemplateRule &
289+
NoLossOfPrecisionRule &
285290
NoMultiSpacesRule &
286291
NoMultipleObjectsInClassRule &
287292
NoMultipleSlotArgsRule &
@@ -292,6 +297,7 @@ export type VueRules = ArrayBracketNewlineRule &
292297
NoRefAsOperandRule &
293298
NoReservedComponentNamesRule &
294299
NoReservedKeysRule &
300+
NoReservedPropsRule &
295301
NoRestrictedBlockRule &
296302
NoRestrictedCallAfterAwaitRule &
297303
NoRestrictedClassRule &

src/rules/vue/max-attributes-per-line.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ export interface MaxAttributesPerLineOption {
88
| number
99
| {
1010
max?: number;
11-
allowFirstLine?: boolean;
1211
};
1312
multiline?:
1413
| number
1514
| {
1615
max?: number;
17-
allowFirstLine?: boolean;
1816
};
1917
}
2018

src/rules/vue/multi-word-component-names.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
import type { RuleConfig } from '../rule-config';
22

3+
/**
4+
* Option.
5+
*/
6+
export interface MultiWordComponentNamesOption {
7+
ignores?: string[];
8+
}
9+
10+
/**
11+
* Options.
12+
*/
13+
export type MultiWordComponentNamesOptions = [MultiWordComponentNamesOption?];
14+
315
/**
416
* Require component names to be always multi-word.
517
*
618
* @see [multi-word-component-names](https://eslint.vuejs.org/rules/multi-word-component-names.html)
719
*/
8-
export type MultiWordComponentNamesRuleConfig = RuleConfig<[]>;
20+
export type MultiWordComponentNamesRuleConfig = RuleConfig<MultiWordComponentNamesOptions>;
921

1022
/**
1123
* Require component names to be always multi-word.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Disallow literal numbers that lose precision.
5+
*
6+
* @see [no-loss-of-precision](https://eslint.vuejs.org/rules/no-loss-of-precision.html)
7+
*/
8+
export type NoLossOfPrecisionRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow literal numbers that lose precision.
12+
*
13+
* @see [no-loss-of-precision](https://eslint.vuejs.org/rules/no-loss-of-precision.html)
14+
*/
15+
export interface NoLossOfPrecisionRule {
16+
/**
17+
* Disallow literal numbers that lose precision.
18+
*
19+
* @see [no-loss-of-precision](https://eslint.vuejs.org/rules/no-loss-of-precision.html)
20+
*/
21+
'vue/no-loss-of-precision': NoLossOfPrecisionRuleConfig;
22+
}

src/rules/vue/no-reserved-props.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface NoReservedPropsOption {
7+
vueVersion?: 2 | 3;
8+
}
9+
10+
/**
11+
* Options.
12+
*/
13+
export type NoReservedPropsOptions = [NoReservedPropsOption?];
14+
15+
/**
16+
* Disallow reserved names in props.
17+
*
18+
* @see [no-reserved-props](https://eslint.vuejs.org/rules/no-reserved-props.html)
19+
*/
20+
export type NoReservedPropsRuleConfig = RuleConfig<NoReservedPropsOptions>;
21+
22+
/**
23+
* Disallow reserved names in props.
24+
*
25+
* @see [no-reserved-props](https://eslint.vuejs.org/rules/no-reserved-props.html)
26+
*/
27+
export interface NoReservedPropsRule {
28+
/**
29+
* Disallow reserved names in props.
30+
*
31+
* @see [no-reserved-props](https://eslint.vuejs.org/rules/no-reserved-props.html)
32+
*/
33+
'vue/no-reserved-props': NoReservedPropsRuleConfig;
34+
}

src/rules/vue/no-unused-properties.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 interface NoUnusedPropertiesOption {
7-
groups?: ('props' | 'data' | 'computed' | 'methods' | 'setup')[];
7+
groups?: ('props' | 'data' | 'asyncData' | 'computed' | 'methods' | 'setup')[];
88
deepData?: boolean;
99
ignorePublicMembers?: boolean;
1010
}

0 commit comments

Comments
 (0)