Skip to content

Commit f44226e

Browse files
committed
Add vue/no-required-prop-with-default to recommended configs (#2640)
1 parent 5f2f5e9 commit f44226e

7 files changed

+7
-2
lines changed

docs/rules/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
182182
| [vue/block-order] | enforce order of component top-level elements | :wrench: | :three::two::hammer: |
183183
| [vue/no-lone-template] | disallow unnecessary `<template>` | | :three::two::warning: |
184184
| [vue/no-multiple-slot-args] | disallow passing multiple arguments to scoped slots | | :three::two::warning: |
185+
| [vue/no-required-prop-with-default] | enforce props with default values to be optional | :wrench::bulb: | :three::two::warning: |
185186
| [vue/no-v-html] | disallow use of v-html to prevent XSS attack | | :three::two::hammer: |
186187
| [vue/order-in-components] | enforce order of properties in components | :wrench::bulb: | :three::two::hammer: |
187188
| [vue/this-in-template] | disallow usage of `this` in template | :wrench: | :three::two::hammer: |
@@ -235,7 +236,6 @@ For example:
235236
| [vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer: |
236237
| [vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb: | :hammer: |
237238
| [vue/no-ref-object-reactivity-loss] | disallow usages of ref objects that can lead to loss of reactivity | | :warning: |
238-
| [vue/no-required-prop-with-default] | enforce props with default values to be optional | :wrench::bulb: | :warning: |
239239
| [vue/no-restricted-block] | disallow specific block | | :hammer: |
240240
| [vue/no-restricted-call-after-await] | disallow asynchronously called restricted methods | | :hammer: |
241241
| [vue/no-restricted-class] | disallow specific classes in Vue components | | :warning: |

docs/rules/no-required-prop-with-default.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ since: v9.6.0
1010

1111
> enforce props with default values to be optional
1212
13+
- :gear: This rule is included in all of `"plugin:vue/recommended"`, `*.configs["flat/vue2-recommended"]`, `"plugin:vue/vue3-recommended"` and `*.configs["flat/recommended"]`.
1314
- :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.
1415
- :bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
1516

lib/configs/flat/vue2-recommended.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = [
1515
'vue/block-order': 'warn',
1616
'vue/no-lone-template': 'warn',
1717
'vue/no-multiple-slot-args': 'warn',
18+
'vue/no-required-prop-with-default': 'warn',
1819
'vue/no-v-html': 'warn',
1920
'vue/order-in-components': 'warn',
2021
'vue/this-in-template': 'warn'

lib/configs/flat/vue3-recommended.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = [
1515
'vue/block-order': 'warn',
1616
'vue/no-lone-template': 'warn',
1717
'vue/no-multiple-slot-args': 'warn',
18+
'vue/no-required-prop-with-default': 'warn',
1819
'vue/no-v-html': 'warn',
1920
'vue/order-in-components': 'warn',
2021
'vue/this-in-template': 'warn'

lib/configs/vue2-recommended.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
'vue/block-order': 'warn',
1111
'vue/no-lone-template': 'warn',
1212
'vue/no-multiple-slot-args': 'warn',
13+
'vue/no-required-prop-with-default': 'warn',
1314
'vue/no-v-html': 'warn',
1415
'vue/order-in-components': 'warn',
1516
'vue/this-in-template': 'warn'

lib/configs/vue3-recommended.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
'vue/block-order': 'warn',
1111
'vue/no-lone-template': 'warn',
1212
'vue/no-multiple-slot-args': 'warn',
13+
'vue/no-required-prop-with-default': 'warn',
1314
'vue/no-v-html': 'warn',
1415
'vue/order-in-components': 'warn',
1516
'vue/this-in-template': 'warn'

lib/rules/no-required-prop-with-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
type: 'problem',
1818
docs: {
1919
description: 'enforce props with default values to be optional',
20-
categories: undefined,
20+
categories: ['vue2-recommended', 'vue3-recommended'],
2121
url: 'https://eslint.vuejs.org/rules/no-required-prop-with-default.html'
2222
},
2323
fixable: 'code',

0 commit comments

Comments
 (0)