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

Commit b6df879

Browse files
committed
Update vue rules
1 parent 835f7f9 commit b6df879

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ import type { NoRestrictedCallAfterAwaitRule } from './no-restricted-call-after-
103103
import type { NoRestrictedClassRule } from './no-restricted-class';
104104
import type { NoRestrictedComponentOptionsRule } from './no-restricted-component-options';
105105
import type { NoRestrictedCustomEventRule } from './no-restricted-custom-event';
106+
import type { NoRestrictedHtmlElementsRule } from './no-restricted-html-elements';
106107
import type { NoRestrictedPropsRule } from './no-restricted-props';
107108
import type { NoRestrictedStaticAttributeRule } from './no-restricted-static-attribute';
108109
import type { NoRestrictedSyntaxRule } from './no-restricted-syntax';
@@ -148,6 +149,7 @@ import type { OperatorLinebreakRule } from './operator-linebreak';
148149
import type { OrderInComponentsRule } from './order-in-components';
149150
import type { PaddingLineBetweenBlocksRule } from './padding-line-between-blocks';
150151
import type { PreferImportFromVueRule } from './prefer-import-from-vue';
152+
import type { PreferPropTypeBooleanFirstRule } from './prefer-prop-type-boolean-first';
151153
import type { PreferSeparateStaticClassRule } from './prefer-separate-static-class';
152154
import type { PreferTemplateRule } from './prefer-template';
153155
import type { PreferTrueAttributeShorthandRule } from './prefer-true-attribute-shorthand';
@@ -316,6 +318,7 @@ export type VueRules = ArrayBracketNewlineRule &
316318
NoRestrictedClassRule &
317319
NoRestrictedComponentOptionsRule &
318320
NoRestrictedCustomEventRule &
321+
NoRestrictedHtmlElementsRule &
319322
NoRestrictedPropsRule &
320323
NoRestrictedStaticAttributeRule &
321324
NoRestrictedSyntaxRule &
@@ -361,6 +364,7 @@ export type VueRules = ArrayBracketNewlineRule &
361364
OrderInComponentsRule &
362365
PaddingLineBetweenBlocksRule &
363366
PreferImportFromVueRule &
367+
PreferPropTypeBooleanFirstRule &
364368
PreferSeparateStaticClassRule &
365369
PreferTemplateRule &
366370
PreferTrueAttributeShorthandRule &
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type NoRestrictedHtmlElementsOption = (
7+
| string
8+
| {
9+
element: string;
10+
message?: string;
11+
}
12+
)[];
13+
14+
/**
15+
* Options.
16+
*/
17+
export type NoRestrictedHtmlElementsOptions = NoRestrictedHtmlElementsOption;
18+
19+
/**
20+
* Disallow specific HTML elements.
21+
*
22+
* @see [no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements.html)
23+
*/
24+
export type NoRestrictedHtmlElementsRuleConfig =
25+
RuleConfig<NoRestrictedHtmlElementsOptions>;
26+
27+
/**
28+
* Disallow specific HTML elements.
29+
*
30+
* @see [no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements.html)
31+
*/
32+
export interface NoRestrictedHtmlElementsRule {
33+
/**
34+
* Disallow specific HTML elements.
35+
*
36+
* @see [no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements.html)
37+
*/
38+
'vue/no-restricted-html-elements': NoRestrictedHtmlElementsRuleConfig;
39+
}
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+
* Enforce `Boolean` comes first in component prop types.
5+
*
6+
* @see [prefer-prop-type-boolean-first](https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html)
7+
*/
8+
export type PreferPropTypeBooleanFirstRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Enforce `Boolean` comes first in component prop types.
12+
*
13+
* @see [prefer-prop-type-boolean-first](https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html)
14+
*/
15+
export interface PreferPropTypeBooleanFirstRule {
16+
/**
17+
* Enforce `Boolean` comes first in component prop types.
18+
*
19+
* @see [prefer-prop-type-boolean-first](https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html)
20+
*/
21+
'vue/prefer-prop-type-boolean-first': PreferPropTypeBooleanFirstRuleConfig;
22+
}

0 commit comments

Comments
 (0)