Skip to content

Commit 186833a

Browse files
Change presets configs and remove unused internal methods (#1848)
* Change presets configs and remove unused internal methods * fix test * format * Rename no-invalid-model-keys to valid-model-definition * Update preset * Add rules to essential preset * Fix lint errors after merge conflict resolution Co-authored-by: Flo Edelmann <[email protected]>
1 parent 58cb406 commit 186833a

36 files changed

+397
-98
lines changed

Diff for: docs/rules/README.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
4545
| [vue/multi-word-component-names](./multi-word-component-names.md) | require component names to be always multi-word | | :three::two::hammer: |
4646
| [vue/no-arrow-functions-in-watch](./no-arrow-functions-in-watch.md) | disallow using arrow functions to define watcher | | :three::two::warning: |
4747
| [vue/no-async-in-computed-properties](./no-async-in-computed-properties.md) | disallow asynchronous actions in computed properties | | :three::two::warning: |
48+
| [vue/no-child-content](./no-child-content.md) | disallow element's child contents which would be overwritten by a directive like `v-html` or `v-text` | :bulb: | :three::two::warning: |
4849
| [vue/no-computed-properties-in-data](./no-computed-properties-in-data.md) | disallow accessing computed properties in `data`. | | :three::two::warning: |
4950
| [vue/no-custom-modifiers-on-v-model](./no-custom-modifiers-on-v-model.md) | disallow custom modifiers on v-model used on the component | | :two::warning: |
5051
| [vue/no-deprecated-data-object-declaration](./no-deprecated-data-object-declaration.md) | disallow using deprecated object declaration on data (in Vue.js 3.0.0+) | :wrench: | :three::warning: |
@@ -69,27 +70,32 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
6970
| [vue/no-dupe-keys](./no-dupe-keys.md) | disallow duplication of field names | | :three::two::warning: |
7071
| [vue/no-dupe-v-else-if](./no-dupe-v-else-if.md) | disallow duplicate conditions in `v-if` / `v-else-if` chains | | :three::two::warning: |
7172
| [vue/no-duplicate-attributes](./no-duplicate-attributes.md) | disallow duplication of attributes | | :three::two::warning: |
72-
| [vue/no-export-in-script-setup](./no-export-in-script-setup.md) | disallow `export` in `<script setup>` | | :three::warning: |
73+
| [vue/no-export-in-script-setup](./no-export-in-script-setup.md) | disallow `export` in `<script setup>` | | :three::two::warning: |
74+
| [vue/no-expose-after-await](./no-expose-after-await.md) | disallow asynchronously registered `expose` | | :three::warning: |
7375
| [vue/no-lifecycle-after-await](./no-lifecycle-after-await.md) | disallow asynchronously registered lifecycle hooks | | :three::hammer: |
7476
| [vue/no-multiple-template-root](./no-multiple-template-root.md) | disallow adding multiple root nodes to the template | | :two::warning: |
7577
| [vue/no-mutating-props](./no-mutating-props.md) | disallow mutation of component props | | :three::two::hammer: |
7678
| [vue/no-parsing-error](./no-parsing-error.md) | disallow parsing errors in `<template>` | | :three::two::warning: |
77-
| [vue/no-ref-as-operand](./no-ref-as-operand.md) | disallow use of value wrapped by `ref()` (Composition API) as an operand | :wrench: | :three::hammer: |
79+
| [vue/no-ref-as-operand](./no-ref-as-operand.md) | disallow use of value wrapped by `ref()` (Composition API) as an operand | :wrench: | :three::two::hammer: |
80+
| [vue/no-reserved-component-names](./no-reserved-component-names.md) | disallow the use of reserved names in component definitions | | :three::two::hammer: |
7881
| [vue/no-reserved-keys](./no-reserved-keys.md) | disallow overwriting reserved keys | | :three::two::hammer: |
7982
| [vue/no-reserved-props](./no-reserved-props.md) | disallow reserved names in props | | :three::two::warning: |
80-
| [vue/no-setup-props-destructure](./no-setup-props-destructure.md) | disallow destructuring of `props` passed to `setup` | | :three::hammer: |
83+
| [vue/no-setup-props-destructure](./no-setup-props-destructure.md) | disallow destructuring of `props` passed to `setup` | | :three::two::hammer: |
8184
| [vue/no-shared-component-data](./no-shared-component-data.md) | enforce component's data property to be a function | :wrench: | :three::two::warning: |
8285
| [vue/no-side-effects-in-computed-properties](./no-side-effects-in-computed-properties.md) | disallow side effects in computed properties | | :three::two::warning: |
8386
| [vue/no-template-key](./no-template-key.md) | disallow `key` attribute on `<template>` | | :three::two::warning: |
8487
| [vue/no-textarea-mustache](./no-textarea-mustache.md) | disallow mustaches in `<textarea>` | | :three::two::warning: |
8588
| [vue/no-unused-components](./no-unused-components.md) | disallow registering components that are not used inside templates | | :three::two::hammer: |
8689
| [vue/no-unused-vars](./no-unused-vars.md) | disallow unused variable definitions of v-for directives or scope attributes | :bulb: | :three::two::hammer: |
90+
| [vue/no-use-computed-property-like-method](./no-use-computed-property-like-method.md) | disallow use computed property like method | | :three::two::warning: |
8791
| [vue/no-use-v-if-with-v-for](./no-use-v-if-with-v-for.md) | disallow use v-if on the same element as v-for | | :three::two::hammer: |
8892
| [vue/no-useless-template-attributes](./no-useless-template-attributes.md) | disallow useless attribute on `<template>` | | :three::two::warning: |
8993
| [vue/no-v-for-template-key-on-child](./no-v-for-template-key-on-child.md) | disallow key of `<template v-for>` placed on child elements | | :three::warning: |
9094
| [vue/no-v-for-template-key](./no-v-for-template-key.md) | disallow `key` attribute on `<template v-for>` | | :two::warning: |
9195
| [vue/no-v-model-argument](./no-v-model-argument.md) | disallow adding an argument to `v-model` used in custom component | | :two::warning: |
96+
| [vue/no-v-text-v-html-on-component](./no-v-text-v-html-on-component.md) | disallow v-text / v-html on component | | :three::two::warning: |
9297
| [vue/no-watch-after-await](./no-watch-after-await.md) | disallow asynchronously registered `watch` | | :three::hammer: |
98+
| [vue/prefer-import-from-vue](./prefer-import-from-vue.md) | enforce import from 'vue' instead of import from '@vue/*' | :wrench: | :three::hammer: |
9399
| [vue/require-component-is](./require-component-is.md) | require `v-bind:is` of `<component>` elements | | :three::two::warning: |
94100
| [vue/require-prop-type-constructor](./require-prop-type-constructor.md) | require prop type to be a constructor | :wrench: | :three::two::hammer: |
95101
| [vue/require-render-return](./require-render-return.md) | enforce render function to always return value | | :three::two::warning: |
@@ -98,10 +104,11 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
98104
| [vue/require-v-for-key](./require-v-for-key.md) | require `v-bind:key` with `v-for` directives | | :three::two::warning: |
99105
| [vue/require-valid-default-prop](./require-valid-default-prop.md) | enforce props default values to be valid | | :three::two::hammer: |
100106
| [vue/return-in-computed-property](./return-in-computed-property.md) | enforce that a return statement is present in computed property | | :three::two::warning: |
101-
| [vue/return-in-emits-validator](./return-in-emits-validator.md) | enforce that a return statement is present in emits validator | | :three::warning: |
107+
| [vue/return-in-emits-validator](./return-in-emits-validator.md) | enforce that a return statement is present in emits validator | | :three::two::warning: |
102108
| [vue/use-v-on-exact](./use-v-on-exact.md) | enforce usage of `exact` modifier on `v-on` | | :three::two::hammer: |
103-
| [vue/valid-define-emits](./valid-define-emits.md) | enforce valid `defineEmits` compiler macro | | :three::warning: |
104-
| [vue/valid-define-props](./valid-define-props.md) | enforce valid `defineProps` compiler macro | | :three::warning: |
109+
| [vue/valid-define-emits](./valid-define-emits.md) | enforce valid `defineEmits` compiler macro | | :three::two::warning: |
110+
| [vue/valid-define-props](./valid-define-props.md) | enforce valid `defineProps` compiler macro | | :three::two::warning: |
111+
| [vue/valid-model-definition](./valid-model-definition.md) | require valid keys in model option | | :two::warning: |
105112
| [vue/valid-next-tick](./valid-next-tick.md) | enforce valid `nextTick` function calls | :wrench::bulb: | :three::two::warning: |
106113
| [vue/valid-template-root](./valid-template-root.md) | enforce valid template root | | :three::two::warning: |
107114
| [vue/valid-v-bind-sync](./valid-v-bind-sync.md) | enforce valid `.sync` modifier on `v-bind` directives | | :two::warning: |
@@ -216,14 +223,10 @@ For example:
216223
| [vue/next-tick-style](./next-tick-style.md) | enforce Promise or callback style in `nextTick` | :wrench: | :hammer: |
217224
| [vue/no-bare-strings-in-template](./no-bare-strings-in-template.md) | disallow the use of bare strings in `<template>` | | :hammer: |
218225
| [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: | :hammer: |
219-
| [vue/no-child-content](./no-child-content.md) | disallow element's child contents which would be overwritten by a directive like `v-html` or `v-text` | :bulb: | :warning: |
220226
| [vue/no-duplicate-attr-inheritance](./no-duplicate-attr-inheritance.md) | enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"` | | :hammer: |
221227
| [vue/no-empty-component-block](./no-empty-component-block.md) | disallow the `<template>` `<script>` `<style>` block to be empty | | :hammer: |
222-
| [vue/no-expose-after-await](./no-expose-after-await.md) | disallow asynchronously registered `expose` | | :warning: |
223-
| [vue/no-invalid-model-keys](./no-invalid-model-keys.md) | require valid keys in model option | | :warning: |
224228
| [vue/no-multiple-objects-in-class](./no-multiple-objects-in-class.md) | disallow to pass multiple objects into array to class | | :hammer: |
225229
| [vue/no-potential-component-option-typo](./no-potential-component-option-typo.md) | disallow a potential typo in your component property | :bulb: | :hammer: |
226-
| [vue/no-reserved-component-names](./no-reserved-component-names.md) | disallow the use of reserved names in component definitions | | :hammer: |
227230
| [vue/no-restricted-block](./no-restricted-block.md) | disallow specific block | | :hammer: |
228231
| [vue/no-restricted-call-after-await](./no-restricted-call-after-await.md) | disallow asynchronously called restricted methods | | :hammer: |
229232
| [vue/no-restricted-class](./no-restricted-class.md) | disallow specific classes in Vue components | | :warning: |
@@ -241,13 +244,10 @@ For example:
241244
| [vue/no-unsupported-features](./no-unsupported-features.md) | disallow unsupported Vue.js syntax on the specified version | :wrench: | :hammer: |
242245
| [vue/no-unused-properties](./no-unused-properties.md) | disallow unused properties | | :hammer: |
243246
| [vue/no-unused-refs](./no-unused-refs.md) | disallow unused refs | | :hammer: |
244-
| [vue/no-use-computed-property-like-method](./no-use-computed-property-like-method.md) | disallow use computed property like method | | :warning: |
245247
| [vue/no-useless-mustaches](./no-useless-mustaches.md) | disallow unnecessary mustache interpolations | :wrench: | :hammer: |
246248
| [vue/no-useless-v-bind](./no-useless-v-bind.md) | disallow unnecessary `v-bind` directives | :wrench: | :hammer: |
247-
| [vue/no-v-text-v-html-on-component](./no-v-text-v-html-on-component.md) | disallow v-text / v-html on component | | :warning: |
248249
| [vue/no-v-text](./no-v-text.md) | disallow use of v-text | | :hammer: |
249250
| [vue/padding-line-between-blocks](./padding-line-between-blocks.md) | require or disallow padding lines between blocks | :wrench: | :lipstick: |
250-
| [vue/prefer-import-from-vue](./prefer-import-from-vue.md) | enforce import from 'vue' instead of import from '@vue/*' | :wrench: | :hammer: |
251251
| [vue/prefer-prop-type-boolean-first](./prefer-prop-type-boolean-first.md) | enforce `Boolean` comes first in component prop types | :bulb: | :warning: |
252252
| [vue/prefer-separate-static-class](./prefer-separate-static-class.md) | require static class names in template to be in a separate `class` attribute | :wrench: | :hammer: |
253253
| [vue/prefer-true-attribute-shorthand](./prefer-true-attribute-shorthand.md) | require shorthand form attribute when `v-bind` value is `true` | :bulb: | :hammer: |
@@ -319,4 +319,5 @@ The following rules extend the rules provided by ESLint itself and apply them to
319319
| [vue/experimental-script-setup-vars](./experimental-script-setup-vars.md) | (no replacement) |
320320
| [vue/name-property-casing](./name-property-casing.md) | [vue/component-definition-name-casing](./component-definition-name-casing.md) |
321321
| [vue/no-confusing-v-for-v-if](./no-confusing-v-for-v-if.md) | [vue/no-use-v-if-with-v-for](./no-use-v-if-with-v-for.md) |
322+
| [vue/no-invalid-model-keys](./no-invalid-model-keys.md) | [vue/valid-model-definition](./valid-model-definition.md) |
322323
| [vue/no-unregistered-components](./no-unregistered-components.md) | [vue/no-undef-components](./no-undef-components.md) |

Diff for: docs/rules/no-child-content.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ since: v8.1.0
99

1010
> disallow element's child contents which would be overwritten by a directive like `v-html` or `v-text`
1111
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1213
- :bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
1314

1415
## :book: Rule Details

Diff for: docs/rules/no-export-in-script-setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.13.0
99

1010
> disallow `export` in `<script setup>`
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313

1414
## :book: Rule Details
1515

Diff for: docs/rules/no-expose-after-await.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ since: v8.1.0
99

1010
> disallow asynchronously registered `expose`
1111
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
13+
1214
## :book: Rule Details
1315

1416
This rule reports usages of `expose()` after an `await` expression.

Diff for: docs/rules/no-invalid-model-keys.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ since: v7.9.0
99

1010
> require valid keys in model option
1111
12+
- :warning: This rule was **deprecated** and replaced by [vue/valid-model-definition](valid-model-definition.md) rule.
13+
1214
## :book: Rule Details
1315

1416
This rule is aimed at preventing invalid keys in model option.

Diff for: docs/rules/no-ref-as-operand.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.0.0
99

1010
> disallow use of value wrapped by `ref()` (Composition API) as an operand
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
1414

1515
## :book: Rule Details

Diff for: docs/rules/no-reserved-component-names.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ since: v6.1.0
99

1010
> disallow the use of reserved names in component definitions
1111
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
13+
1214
## :book: Rule Details
1315

1416
This rule prevents name collisions between Vue components and standard HTML elements and built-in components.

Diff for: docs/rules/no-setup-props-destructure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.0.0
99

1010
> disallow destructuring of `props` passed to `setup`
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313

1414
## :book: Rule Details
1515

Diff for: docs/rules/no-use-computed-property-like-method.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ since: v7.15.0
99

1010
> disallow use computed property like method
1111
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
13+
1214
## :book: Rule Details
1315

1416
This rule disallows to use computed property like method.

Diff for: docs/rules/no-v-text-v-html-on-component.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ since: v8.4.0
99

1010
> disallow v-text / v-html on component
1111
12+
- :gear: This rule is included in all of `"plugin:vue/essential"`, `"plugin:vue/vue3-essential"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/recommended"` and `"plugin:vue/vue3-recommended"`.
13+
1214
## :book: Rule Details
1315

1416
This rule disallows the use of v-text / v-html on component.

Diff for: docs/rules/prefer-import-from-vue.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ since: v8.5.0
99

1010
> enforce import from 'vue' instead of import from '@vue/*'
1111
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
1213
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
1314

1415
## :book: Rule Details

Diff for: docs/rules/return-in-emits-validator.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.0.0
99

1010
> enforce that a return statement is present in emits validator
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313

1414
## :book: Rule Details
1515

Diff for: docs/rules/valid-define-emits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.13.0
99

1010
> enforce valid `defineEmits` compiler macro
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313

1414
This rule checks whether `defineEmits` compiler macro is valid.
1515

Diff for: docs/rules/valid-define-props.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ since: v7.13.0
99

1010
> enforce valid `defineProps` compiler macro
1111
12-
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
12+
- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/essential"`, `"plugin:vue/vue3-strongly-recommended"`, `"plugin:vue/strongly-recommended"`, `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
1313

1414
This rule checks whether `defineProps` compiler macro is valid.
1515

0 commit comments

Comments
 (0)