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

Commit 1edad4d

Browse files
committed
Update vue rules
1 parent 852375d commit 1edad4d

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
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 DefineMacrosOrderOption {
7+
order?: ('defineEmits' | 'defineProps')[];
8+
}
9+
10+
/**
11+
* Options.
12+
*/
13+
export type DefineMacrosOrderOptions = [DefineMacrosOrderOption?];
14+
15+
/**
16+
* Enforce order of `defineEmits` and `defineProps` compiler macros.
17+
*
18+
* @see [define-macros-order](https://eslint.vuejs.org/rules/define-macros-order.html)
19+
*/
20+
export type DefineMacrosOrderRuleConfig = RuleConfig<DefineMacrosOrderOptions>;
21+
22+
/**
23+
* Enforce order of `defineEmits` and `defineProps` compiler macros.
24+
*
25+
* @see [define-macros-order](https://eslint.vuejs.org/rules/define-macros-order.html)
26+
*/
27+
export interface DefineMacrosOrderRule {
28+
/**
29+
* Enforce order of `defineEmits` and `defineProps` compiler macros.
30+
*
31+
* @see [define-macros-order](https://eslint.vuejs.org/rules/define-macros-order.html)
32+
*/
33+
'vue/define-macros-order': DefineMacrosOrderRuleConfig;
34+
}

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type { ComponentNameInTemplateCasingRule } from './component-name-in-temp
1818
import type { ComponentOptionsNameCasingRule } from './component-options-name-casing';
1919
import type { ComponentTagsOrderRule } from './component-tags-order';
2020
import type { CustomEventNameCasingRule } from './custom-event-name-casing';
21+
import type { DefineMacrosOrderRule } from './define-macros-order';
2122
import type { DotLocationRule } from './dot-location';
2223
import type { DotNotationRule } from './dot-notation';
2324
import type { EqeqeqRule } from './eqeqeq';
@@ -38,6 +39,7 @@ import type { JsxUsesVarsRule } from './jsx-uses-vars';
3839
import type { KeySpacingRule } from './key-spacing';
3940
import type { KeywordSpacingRule } from './keyword-spacing';
4041
import type { MatchComponentFileNameRule } from './match-component-file-name';
42+
import type { MatchComponentImportNameRule } from './match-component-import-name';
4143
import type { MaxAttributesPerLineRule } from './max-attributes-per-line';
4244
import type { MaxLenRule } from './max-len';
4345
import type { MultiWordComponentNamesRule } from './multi-word-component-names';
@@ -233,6 +235,7 @@ export type VueRules = ArrayBracketNewlineRule &
233235
ComponentOptionsNameCasingRule &
234236
ComponentTagsOrderRule &
235237
CustomEventNameCasingRule &
238+
DefineMacrosOrderRule &
236239
DotLocationRule &
237240
DotNotationRule &
238241
EqeqeqRule &
@@ -253,6 +256,7 @@ export type VueRules = ArrayBracketNewlineRule &
253256
KeySpacingRule &
254257
KeywordSpacingRule &
255258
MatchComponentFileNameRule &
259+
MatchComponentImportNameRule &
256260
MaxAttributesPerLineRule &
257261
MaxLenRule &
258262
MultiWordComponentNamesRule &
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+
* Require the registered component name to match the imported component name.
5+
*
6+
* @see [match-component-import-name](https://eslint.vuejs.org/rules/match-component-import-name.html)
7+
*/
8+
export type MatchComponentImportNameRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Require the registered component name to match the imported component name.
12+
*
13+
* @see [match-component-import-name](https://eslint.vuejs.org/rules/match-component-import-name.html)
14+
*/
15+
export interface MatchComponentImportNameRule {
16+
/**
17+
* Require the registered component name to match the imported component name.
18+
*
19+
* @see [match-component-import-name](https://eslint.vuejs.org/rules/match-component-import-name.html)
20+
*/
21+
'vue/match-component-import-name': MatchComponentImportNameRuleConfig;
22+
}

0 commit comments

Comments
 (0)