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

Commit e9414c6

Browse files
committed
Update vue rules
1 parent c906cf5 commit e9414c6

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type ArrayElementNewlineOption =
7+
| []
8+
| [
9+
| BasicConfig
10+
| {
11+
ArrayExpression?: BasicConfig;
12+
ArrayPattern?: BasicConfig;
13+
},
14+
];
15+
export type BasicConfig =
16+
| ('always' | 'never' | 'consistent')
17+
| {
18+
multiline?: boolean;
19+
minItems?: number | null;
20+
};
21+
22+
/**
23+
* Options.
24+
*/
25+
export type ArrayElementNewlineOptions = ArrayElementNewlineOption;
26+
27+
/**
28+
* Enforce line breaks after each array element in `<template>`.
29+
*
30+
* @see [array-element-newline](https://eslint.vuejs.org/rules/array-element-newline.html)
31+
*/
32+
export type ArrayElementNewlineRuleConfig =
33+
RuleConfig<ArrayElementNewlineOptions>;
34+
35+
/**
36+
* Enforce line breaks after each array element in `<template>`.
37+
*
38+
* @see [array-element-newline](https://eslint.vuejs.org/rules/array-element-newline.html)
39+
*/
40+
export interface ArrayElementNewlineRule {
41+
/**
42+
* Enforce line breaks after each array element in `<template>`.
43+
*
44+
* @see [array-element-newline](https://eslint.vuejs.org/rules/array-element-newline.html)
45+
*/
46+
'vue/array-element-newline': ArrayElementNewlineRuleConfig;
47+
}

src/rules/vue/attributes-order.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export interface AttributesOrderOption {
1616
| 'TWO_WAY_BINDING'
1717
| 'OTHER_DIRECTIVES'
1818
| 'OTHER_ATTR'
19+
| 'ATTR_STATIC'
20+
| 'ATTR_DYNAMIC'
21+
| 'ATTR_SHORTHAND_BOOL'
1922
| 'EVENTS'
2023
| 'CONTENT'
2124
)
@@ -30,6 +33,9 @@ export interface AttributesOrderOption {
3033
| 'TWO_WAY_BINDING'
3134
| 'OTHER_DIRECTIVES'
3235
| 'OTHER_ATTR'
36+
| 'ATTR_STATIC'
37+
| 'ATTR_DYNAMIC'
38+
| 'ATTR_SHORTHAND_BOOL'
3339
| 'EVENTS'
3440
| 'CONTENT'
3541
)[]

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ArrayBracketNewlineRule } from './array-bracket-newline';
22
import type { ArrayBracketSpacingRule } from './array-bracket-spacing';
3+
import type { ArrayElementNewlineRule } from './array-element-newline';
34
import type { ArrowSpacingRule } from './arrow-spacing';
45
import type { AttributeHyphenationRule } from './attribute-hyphenation';
56
import type { AttributesOrderRule } from './attributes-order';
@@ -153,6 +154,7 @@ import type { OperatorLinebreakRule } from './operator-linebreak';
153154
import type { OrderInComponentsRule } from './order-in-components';
154155
import type { PaddingLineBetweenBlocksRule } from './padding-line-between-blocks';
155156
import type { PaddingLineBetweenTagsRule } from './padding-line-between-tags';
157+
import type { PaddingLinesInComponentDefinitionRule } from './padding-lines-in-component-definition';
156158
import type { PreferImportFromVueRule } from './prefer-import-from-vue';
157159
import type { PreferPropTypeBooleanFirstRule } from './prefer-prop-type-boolean-first';
158160
import type { PreferSeparateStaticClassRule } from './prefer-separate-static-class';
@@ -224,6 +226,7 @@ import type { ValidVTextRule } from './valid-v-text';
224226
*/
225227
export type VueRules = ArrayBracketNewlineRule &
226228
ArrayBracketSpacingRule &
229+
ArrayElementNewlineRule &
227230
ArrowSpacingRule &
228231
AttributeHyphenationRule &
229232
AttributesOrderRule &
@@ -377,6 +380,7 @@ export type VueRules = ArrayBracketNewlineRule &
377380
OrderInComponentsRule &
378381
PaddingLineBetweenBlocksRule &
379382
PaddingLineBetweenTagsRule &
383+
PaddingLinesInComponentDefinitionRule &
380384
PreferImportFromVueRule &
381385
PreferPropTypeBooleanFirstRule &
382386
PreferSeparateStaticClassRule &
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type PaddingLinesInComponentDefinitionOption =
7+
| ('always' | 'never')
8+
| {
9+
betweenOptions?: 'never' | 'always' | 'ignore';
10+
withinOption?:
11+
| ('never' | 'always' | 'ignore')
12+
| {
13+
/**
14+
*/
15+
[k: string]:
16+
| ('never' | 'always' | 'ignore')
17+
| {
18+
betweenItems?: 'never' | 'always' | 'ignore';
19+
withinEach?: 'never' | 'always' | 'ignore';
20+
};
21+
};
22+
groupSingleLineProperties?: boolean;
23+
};
24+
25+
/**
26+
* Options.
27+
*/
28+
export type PaddingLinesInComponentDefinitionOptions = [
29+
PaddingLinesInComponentDefinitionOption?,
30+
];
31+
32+
/**
33+
* Require or disallow padding lines in component definition.
34+
*
35+
* @see [padding-lines-in-component-definition](https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html)
36+
*/
37+
export type PaddingLinesInComponentDefinitionRuleConfig =
38+
RuleConfig<PaddingLinesInComponentDefinitionOptions>;
39+
40+
/**
41+
* Require or disallow padding lines in component definition.
42+
*
43+
* @see [padding-lines-in-component-definition](https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html)
44+
*/
45+
export interface PaddingLinesInComponentDefinitionRule {
46+
/**
47+
* Require or disallow padding lines in component definition.
48+
*
49+
* @see [padding-lines-in-component-definition](https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html)
50+
*/
51+
'vue/padding-lines-in-component-definition': PaddingLinesInComponentDefinitionRuleConfig;
52+
}

0 commit comments

Comments
 (0)