Skip to content

Commit

Permalink
Add vue/valid-define-options to vue3-essential config (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
waynzh authored Dec 17, 2024
1 parent c7d1e26 commit 43d6a91
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
| [vue/use-v-on-exact] | enforce usage of `exact` modifier on `v-on` | | :three::two::hammer: |
| [vue/valid-attribute-name] | require valid attribute names | | :three::two::warning: |
| [vue/valid-define-emits] | enforce valid `defineEmits` compiler macro | | :three::two::warning: |
| [vue/valid-define-options] | enforce valid `defineOptions` compiler macro | | :three::warning: |
| [vue/valid-define-props] | enforce valid `defineProps` compiler macro | | :three::two::warning: |
| [vue/valid-model-definition] | require valid keys in model option | | :two::warning: |
| [vue/valid-next-tick] | enforce valid `nextTick` function calls | :wrench::bulb: | :three::two::warning: |
Expand Down Expand Up @@ -288,7 +289,6 @@ For example:
| [vue/v-for-delimiter-style] | enforce `v-for` directive's delimiter style | :wrench: | :lipstick: |
| [vue/v-if-else-key] | require key attribute for conditionally rendered repeated components | :wrench: | :warning: |
| [vue/v-on-handler-style] | enforce writing style for handlers in `v-on` directives | :wrench: | :hammer: |
| [vue/valid-define-options] | enforce valid `defineOptions` compiler macro | | :warning: |

</rules-table>

Expand Down
2 changes: 2 additions & 0 deletions docs/rules/valid-define-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ since: v9.13.0

> enforce valid `defineOptions` compiler macro
- :gear: This rule is included in all of `"plugin:vue/essential"`, `*.configs["flat/essential"]`, `"plugin:vue/strongly-recommended"`, `*.configs["flat/strongly-recommended"]`, `"plugin:vue/recommended"` and `*.configs["flat/recommended"]`.

This rule checks whether `defineOptions` compiler macro is valid.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions lib/configs/flat/vue3-essential.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = [
'vue/use-v-on-exact': 'error',
'vue/valid-attribute-name': 'error',
'vue/valid-define-emits': 'error',
'vue/valid-define-options': 'error',
'vue/valid-define-props': 'error',
'vue/valid-next-tick': 'error',
'vue/valid-template-root': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/configs/vue3-essential.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = {
'vue/use-v-on-exact': 'error',
'vue/valid-attribute-name': 'error',
'vue/valid-define-emits': 'error',
'vue/valid-define-options': 'error',
'vue/valid-define-props': 'error',
'vue/valid-next-tick': 'error',
'vue/valid-template-root': 'error',
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/valid-define-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ module.exports = {
type: 'problem',
docs: {
description: 'enforce valid `defineOptions` compiler macro',
// TODO Switch in the next major version
// categories: ['vue3-essential', 'vue2-essential'],
categories: undefined,
categories: ['vue3-essential'],
url: 'https://eslint.vuejs.org/rules/valid-define-options.html'
},
fixable: null,
Expand Down

0 comments on commit 43d6a91

Please sign in to comment.