diff --git a/docs/rules/index.md b/docs/rules/index.md index 5ba947d77..5b478d2ed 100644 --- a/docs/rules/index.md +++ b/docs/rules/index.md @@ -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: | @@ -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: | diff --git a/docs/rules/valid-define-options.md b/docs/rules/valid-define-options.md index e4bf647e3..a81d5ad96 100644 --- a/docs/rules/valid-define-options.md +++ b/docs/rules/valid-define-options.md @@ -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 diff --git a/lib/configs/flat/vue3-essential.js b/lib/configs/flat/vue3-essential.js index 1c6cf567e..ff8b5b4a6 100644 --- a/lib/configs/flat/vue3-essential.js +++ b/lib/configs/flat/vue3-essential.js @@ -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', diff --git a/lib/configs/vue3-essential.js b/lib/configs/vue3-essential.js index d5d357f1f..34b3229b1 100644 --- a/lib/configs/vue3-essential.js +++ b/lib/configs/vue3-essential.js @@ -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', diff --git a/lib/rules/valid-define-options.js b/lib/rules/valid-define-options.js index 52f1b8478..12771b8fe 100644 --- a/lib/rules/valid-define-options.js +++ b/lib/rules/valid-define-options.js @@ -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,