Skip to content

Commit

Permalink
Add vue/no-required-prop-with-default to recommended configs (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Jan 3, 2025
1 parent 28a2339 commit 7f18eff
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
| [vue/block-order] | enforce order of component top-level elements | :wrench: | :three::two::hammer: |
| [vue/no-lone-template] | disallow unnecessary `<template>` | | :three::two::warning: |
| [vue/no-multiple-slot-args] | disallow passing multiple arguments to scoped slots | | :three::two::warning: |
| [vue/no-required-prop-with-default] | enforce props with default values to be optional | :wrench::bulb: | :three::two::warning: |
| [vue/no-v-html] | disallow use of v-html to prevent XSS attack | | :three::two::hammer: |
| [vue/order-in-components] | enforce order of properties in components | :wrench::bulb: | :three::two::hammer: |
| [vue/this-in-template] | disallow usage of `this` in template | :wrench: | :three::two::hammer: |
Expand Down Expand Up @@ -235,7 +236,6 @@ For example:
| [vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer: |
| [vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb: | :hammer: |
| [vue/no-ref-object-reactivity-loss] | disallow usages of ref objects that can lead to loss of reactivity | | :warning: |
| [vue/no-required-prop-with-default] | enforce props with default values to be optional | :wrench::bulb: | :warning: |
| [vue/no-restricted-block] | disallow specific block | | :hammer: |
| [vue/no-restricted-call-after-await] | disallow asynchronously called restricted methods | | :hammer: |
| [vue/no-restricted-class] | disallow specific classes in Vue components | | :warning: |
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-required-prop-with-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ since: v9.6.0

> enforce props with default values to be optional
- :gear: This rule is included in all of `"plugin:vue/recommended"`, `*.configs["flat/vue2-recommended"]`, `"plugin:vue/vue3-recommended"` and `*.configs["flat/recommended"]`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fix-problems) can automatically fix some of the problems reported by this rule.
- :bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

Expand Down
1 change: 1 addition & 0 deletions lib/configs/flat/vue2-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = [
'vue/block-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-required-prop-with-default': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
Expand Down
1 change: 1 addition & 0 deletions lib/configs/flat/vue3-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = [
'vue/block-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-required-prop-with-default': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
Expand Down
1 change: 1 addition & 0 deletions lib/configs/vue2-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'vue/block-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-required-prop-with-default': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
Expand Down
1 change: 1 addition & 0 deletions lib/configs/vue3-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'vue/block-order': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-required-prop-with-default': 'warn',
'vue/no-v-html': 'warn',
'vue/order-in-components': 'warn',
'vue/this-in-template': 'warn'
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-required-prop-with-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
type: 'problem',
docs: {
description: 'enforce props with default values to be optional',
categories: undefined,
categories: ['vue2-recommended', 'vue3-recommended'],
url: 'https://eslint.vuejs.org/rules/no-required-prop-with-default.html'
},
fixable: 'code',
Expand Down

0 comments on commit 7f18eff

Please sign in to comment.