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

Commit b2e15c9

Browse files
committed
Add vue rules
1 parent 652f5b7 commit b2e15c9

File tree

5 files changed

+66
-6
lines changed

5 files changed

+66
-6
lines changed

src/rules/vue/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ import type { NoParsingErrorRule } from './no-parsing-error';
104104
import type { NoPotentialComponentOptionTypoRule } from './no-potential-component-option-typo';
105105
import type { NoRefAsOperandRule } from './no-ref-as-operand';
106106
import type { NoRefObjectDestructureRule } from './no-ref-object-destructure';
107+
import type { NoRefObjectReactivityLossRule } from './no-ref-object-reactivity-loss';
107108
import type { NoRequiredPropWithDefaultRule } from './no-required-prop-with-default';
108109
import type { NoReservedComponentNamesRule } from './no-reserved-component-names';
109110
import type { NoReservedKeysRule } from './no-reserved-keys';
@@ -121,6 +122,7 @@ import type { NoRestrictedSyntaxRule } from './no-restricted-syntax';
121122
import type { NoRestrictedVBindRule } from './no-restricted-v-bind';
122123
import type { NoRootVIfRule } from './no-root-v-if';
123124
import type { NoSetupPropsDestructureRule } from './no-setup-props-destructure';
125+
import type { NoSetupPropsReactivityLossRule } from './no-setup-props-reactivity-loss';
124126
import type { NoSharedComponentDataRule } from './no-shared-component-data';
125127
import type { NoSideEffectsInComputedPropertiesRule } from './no-side-effects-in-computed-properties';
126128
import type { NoSpacesAroundEqualSignsInAttributeRule } from './no-spaces-around-equal-signs-in-attribute';
@@ -342,6 +344,7 @@ export type VueRules = ArrayBracketNewlineRule &
342344
NoPotentialComponentOptionTypoRule &
343345
NoRefAsOperandRule &
344346
NoRefObjectDestructureRule &
347+
NoRefObjectReactivityLossRule &
345348
NoRequiredPropWithDefaultRule &
346349
NoReservedComponentNamesRule &
347350
NoReservedKeysRule &
@@ -359,6 +362,7 @@ export type VueRules = ArrayBracketNewlineRule &
359362
NoRestrictedVBindRule &
360363
NoRootVIfRule &
361364
NoSetupPropsDestructureRule &
365+
NoSetupPropsReactivityLossRule &
362366
NoSharedComponentDataRule &
363367
NoSideEffectsInComputedPropertiesRule &
364368
NoSpacesAroundEqualSignsInAttributeRule &

src/rules/vue/no-ref-object-destructure.d.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import type { RuleConfig } from '../rule-config';
22

33
/**
4-
* Disallow destructuring of ref objects that can lead to loss of reactivity.
4+
* Disallow usages of ref objects that can lead to loss of reactivity.
5+
*
6+
* @deprecated
57
*
68
* @see [no-ref-object-destructure](https://eslint.vuejs.org/rules/no-ref-object-destructure.html)
79
*/
810
export type NoRefObjectDestructureRuleConfig = RuleConfig<[]>;
911

1012
/**
11-
* Disallow destructuring of ref objects that can lead to loss of reactivity.
13+
* Disallow usages of ref objects that can lead to loss of reactivity.
14+
*
15+
* @deprecated
1216
*
1317
* @see [no-ref-object-destructure](https://eslint.vuejs.org/rules/no-ref-object-destructure.html)
1418
*/
1519
export interface NoRefObjectDestructureRule {
1620
/**
17-
* Disallow destructuring of ref objects that can lead to loss of reactivity.
21+
* Disallow usages of ref objects that can lead to loss of reactivity.
22+
*
23+
* @deprecated
1824
*
1925
* @see [no-ref-object-destructure](https://eslint.vuejs.org/rules/no-ref-object-destructure.html)
2026
*/
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 usages of ref objects that can lead to loss of reactivity.
5+
*
6+
* @see [no-ref-object-reactivity-loss](https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html)
7+
*/
8+
export type NoRefObjectReactivityLossRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow usages of ref objects that can lead to loss of reactivity.
12+
*
13+
* @see [no-ref-object-reactivity-loss](https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html)
14+
*/
15+
export interface NoRefObjectReactivityLossRule {
16+
/**
17+
* Disallow usages of ref objects that can lead to loss of reactivity.
18+
*
19+
* @see [no-ref-object-reactivity-loss](https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html)
20+
*/
21+
'vue/no-ref-object-reactivity-loss': NoRefObjectReactivityLossRuleConfig;
22+
}

src/rules/vue/no-setup-props-destructure.d.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import type { RuleConfig } from '../rule-config';
22

33
/**
4-
* Disallow destructuring of `props` passed to `setup`.
4+
* Disallow usages that lose the reactivity of `props` passed to `setup`.
5+
*
6+
* @deprecated
57
*
68
* @see [no-setup-props-destructure](https://eslint.vuejs.org/rules/no-setup-props-destructure.html)
79
*/
810
export type NoSetupPropsDestructureRuleConfig = RuleConfig<[]>;
911

1012
/**
11-
* Disallow destructuring of `props` passed to `setup`.
13+
* Disallow usages that lose the reactivity of `props` passed to `setup`.
14+
*
15+
* @deprecated
1216
*
1317
* @see [no-setup-props-destructure](https://eslint.vuejs.org/rules/no-setup-props-destructure.html)
1418
*/
1519
export interface NoSetupPropsDestructureRule {
1620
/**
17-
* Disallow destructuring of `props` passed to `setup`.
21+
* Disallow usages that lose the reactivity of `props` passed to `setup`.
22+
*
23+
* @deprecated
1824
*
1925
* @see [no-setup-props-destructure](https://eslint.vuejs.org/rules/no-setup-props-destructure.html)
2026
*/
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 usages that lose the reactivity of `props` passed to `setup`.
5+
*
6+
* @see [no-setup-props-reactivity-loss](https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html)
7+
*/
8+
export type NoSetupPropsReactivityLossRuleConfig = RuleConfig<[]>;
9+
10+
/**
11+
* Disallow usages that lose the reactivity of `props` passed to `setup`.
12+
*
13+
* @see [no-setup-props-reactivity-loss](https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html)
14+
*/
15+
export interface NoSetupPropsReactivityLossRule {
16+
/**
17+
* Disallow usages that lose the reactivity of `props` passed to `setup`.
18+
*
19+
* @see [no-setup-props-reactivity-loss](https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html)
20+
*/
21+
'vue/no-setup-props-reactivity-loss': NoSetupPropsReactivityLossRuleConfig;
22+
}

0 commit comments

Comments
 (0)