diff --git a/docs/rules/README.md b/docs/rules/README.md index b9d6be74b..5f848467b 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -301,6 +301,7 @@ For example: | [vue/no-multiple-objects-in-class](./no-multiple-objects-in-class.md) | disallow to pass multiple objects into array to class | | | [vue/no-potential-component-option-typo](./no-potential-component-option-typo.md) | disallow a potential typo in your component property | | | [vue/no-reserved-component-names](./no-reserved-component-names.md) | disallow the use of reserved names in component definitions | | +| [vue/no-restricted-block](./no-restricted-block.md) | disallow specific block | | | [vue/no-restricted-call-after-await](./no-restricted-call-after-await.md) | disallow asynchronously called restricted methods | | | [vue/no-restricted-component-options](./no-restricted-component-options.md) | disallow specific component option | | | [vue/no-restricted-custom-event](./no-restricted-custom-event.md) | disallow specific custom event | | diff --git a/docs/rules/no-restricted-block.md b/docs/rules/no-restricted-block.md new file mode 100644 index 000000000..f84b13746 --- /dev/null +++ b/docs/rules/no-restricted-block.md @@ -0,0 +1,88 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/no-restricted-block +description: disallow specific block +--- +# vue/no-restricted-block + +> disallow specific block + +- :exclamation: ***This rule has not been released yet.*** + +## :book: Rule Details + +This rule allows you to specify block names that you don't want to use in your application. + +## :wrench: Options + +This rule takes a list of strings, where each string is a block name or pattern to be restricted: + +```json +{ + "vue/no-restricted-block": ["error", "style", "foo", "bar"] +} +``` + + + +```vue + + + Custom block + + + Custom block + + +``` + + + +Alternatively, the rule also accepts objects. + +```json +{ + "vue/no-restricted-block": ["error", + { + "element": "style", + "message": "Do not use ', + options: ['foo'] + } + ], + invalid: [ + { + filename: 'test.vue', + code: ``, + options: ['style', 'foo'], + errors: [ + { + message: 'Using ` + + `, + options: [ + { + element: 'style', + message: 'Do not use