Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vue/valid-define-options to vue3-essential config #2653

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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