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

Commit 9c9e9e3

Browse files
committed
Update vue rules
1 parent a81b23b commit 9c9e9e3

File tree

5 files changed

+87
-0
lines changed

5 files changed

+87
-0
lines changed

src/rules/vue/component-name-in-template-casing.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { RuleConfig } from '../rule-config';
44
* Config.
55
*/
66
export interface ComponentNameInTemplateCasingConfig {
7+
globals?: string[];
78
ignores?: string[];
89
registeredComponentsOnly?: boolean;
910
}

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import type { MaxAttributesPerLineRule } from './max-attributes-per-line';
4545
import type { MaxLenRule } from './max-len';
4646
import type { MultiWordComponentNamesRule } from './multi-word-component-names';
4747
import type { MultilineHtmlElementContentNewlineRule } from './multiline-html-element-content-newline';
48+
import type { MultilineTernaryRule } from './multiline-ternary';
4849
import type { MustacheInterpolationSpacingRule } from './mustache-interpolation-spacing';
4950
import type { NewLineBetweenMultiLinePropertyRule } from './new-line-between-multi-line-property';
5051
import type { NextTickStyleRule } from './next-tick-style';
@@ -190,6 +191,7 @@ import type { VBindStyleRule } from './v-bind-style';
190191
import type { VForDelimiterStyleRule } from './v-for-delimiter-style';
191192
import type { VOnEventHyphenationRule } from './v-on-event-hyphenation';
192193
import type { VOnFunctionCallRule } from './v-on-function-call';
194+
import type { VOnHandlerStyleRule } from './v-on-handler-style';
193195
import type { VOnStyleRule } from './v-on-style';
194196
import type { VSlotStyleRule } from './v-slot-style';
195197
import type { ValidAttributeNameRule } from './valid-attribute-name';
@@ -266,6 +268,7 @@ export type VueRules = ArrayBracketNewlineRule &
266268
MaxLenRule &
267269
MultiWordComponentNamesRule &
268270
MultilineHtmlElementContentNewlineRule &
271+
MultilineTernaryRule &
269272
MustacheInterpolationSpacingRule &
270273
NewLineBetweenMultiLinePropertyRule &
271274
NextTickStyleRule &
@@ -411,6 +414,7 @@ export type VueRules = ArrayBracketNewlineRule &
411414
VForDelimiterStyleRule &
412415
VOnEventHyphenationRule &
413416
VOnFunctionCallRule &
417+
VOnHandlerStyleRule &
414418
VOnStyleRule &
415419
VSlotStyleRule &
416420
ValidAttributeNameRule &

src/rules/vue/multiline-ternary.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type MultilineTernaryOption = 'always' | 'always-multiline' | 'never';
7+
8+
/**
9+
* Options.
10+
*/
11+
export type MultilineTernaryOptions = [MultilineTernaryOption?];
12+
13+
/**
14+
* Enforce newlines between operands of ternary expressions in `<template>`.
15+
*
16+
* @see [multiline-ternary](https://eslint.vuejs.org/rules/multiline-ternary.html)
17+
*/
18+
export type MultilineTernaryRuleConfig = RuleConfig<MultilineTernaryOptions>;
19+
20+
/**
21+
* Enforce newlines between operands of ternary expressions in `<template>`.
22+
*
23+
* @see [multiline-ternary](https://eslint.vuejs.org/rules/multiline-ternary.html)
24+
*/
25+
export interface MultilineTernaryRule {
26+
/**
27+
* Enforce newlines between operands of ternary expressions in `<template>`.
28+
*
29+
* @see [multiline-ternary](https://eslint.vuejs.org/rules/multiline-ternary.html)
30+
*/
31+
'vue/multiline-ternary': MultilineTernaryRuleConfig;
32+
}

src/rules/vue/v-on-function-call.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,25 @@ export type VOnFunctionCallOptions = [
2323
/**
2424
* Enforce or forbid parentheses after method calls without arguments in `v-on` directives.
2525
*
26+
* @deprecated
27+
*
2628
* @see [v-on-function-call](https://eslint.vuejs.org/rules/v-on-function-call.html)
2729
*/
2830
export type VOnFunctionCallRuleConfig = RuleConfig<VOnFunctionCallOptions>;
2931

3032
/**
3133
* Enforce or forbid parentheses after method calls without arguments in `v-on` directives.
3234
*
35+
* @deprecated
36+
*
3337
* @see [v-on-function-call](https://eslint.vuejs.org/rules/v-on-function-call.html)
3438
*/
3539
export interface VOnFunctionCallRule {
3640
/**
3741
* Enforce or forbid parentheses after method calls without arguments in `v-on` directives.
3842
*
43+
* @deprecated
44+
*
3945
* @see [v-on-function-call](https://eslint.vuejs.org/rules/v-on-function-call.html)
4046
*/
4147
'vue/v-on-function-call': VOnFunctionCallRuleConfig;

src/rules/vue/v-on-handler-style.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Config.
5+
*/
6+
export interface VOnHandlerStyleConfig {
7+
ignoreIncludesComment?: boolean;
8+
}
9+
10+
/**
11+
* Option.
12+
*/
13+
export type VOnHandlerStyleOption =
14+
| ('inline' | 'inline-function')
15+
| ['method', 'inline' | 'inline-function'];
16+
17+
/**
18+
* Options.
19+
*/
20+
export type VOnHandlerStyleOptions = [
21+
VOnHandlerStyleOption?,
22+
VOnHandlerStyleConfig?,
23+
];
24+
25+
/**
26+
* Enforce writing style for handlers in `v-on` directives.
27+
*
28+
* @see [v-on-handler-style](https://eslint.vuejs.org/rules/v-on-handler-style.html)
29+
*/
30+
export type VOnHandlerStyleRuleConfig = RuleConfig<VOnHandlerStyleOptions>;
31+
32+
/**
33+
* Enforce writing style for handlers in `v-on` directives.
34+
*
35+
* @see [v-on-handler-style](https://eslint.vuejs.org/rules/v-on-handler-style.html)
36+
*/
37+
export interface VOnHandlerStyleRule {
38+
/**
39+
* Enforce writing style for handlers in `v-on` directives.
40+
*
41+
* @see [v-on-handler-style](https://eslint.vuejs.org/rules/v-on-handler-style.html)
42+
*/
43+
'vue/v-on-handler-style': VOnHandlerStyleRuleConfig;
44+
}

0 commit comments

Comments
 (0)