Skip to content

Document non-fixable rules correctly #2343

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

Merged
merged 3 commits into from
Dec 27, 2023
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
4 changes: 2 additions & 2 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Rules in this category are enabled for all presets provided by eslint-plugin-vue
| [vue/no-deprecated-slot-attribute](./no-deprecated-slot-attribute.md) | disallow deprecated `slot` attribute (in Vue.js 2.6.0+) | :wrench: | :three::hammer: |
| [vue/no-deprecated-slot-scope-attribute](./no-deprecated-slot-scope-attribute.md) | disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+) | :wrench: | :three::hammer: |
| [vue/no-deprecated-v-bind-sync](./no-deprecated-v-bind-sync.md) | disallow use of deprecated `.sync` modifier on `v-bind` directive (in Vue.js 3.0.0+) | :wrench: | :three::warning: |
| [vue/no-deprecated-v-is](./no-deprecated-v-is.md) | disallow deprecated `v-is` directive (in Vue.js 3.1.0+) | :wrench: | :three::hammer: |
| [vue/no-deprecated-v-is](./no-deprecated-v-is.md) | disallow deprecated `v-is` directive (in Vue.js 3.1.0+) | | :three::hammer: |
| [vue/no-deprecated-v-on-native-modifier](./no-deprecated-v-on-native-modifier.md) | disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+) | | :three::warning: |
| [vue/no-deprecated-v-on-number-modifiers](./no-deprecated-v-on-number-modifiers.md) | disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+) | :wrench: | :three::warning: |
| [vue/no-deprecated-vue-config-keycodes](./no-deprecated-vue-config-keycodes.md) | disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+) | | :three::warning: |
Expand Down Expand Up @@ -225,7 +225,7 @@ For example:
| [vue/new-line-between-multi-line-property](./new-line-between-multi-line-property.md) | enforce new lines between multi-line properties in Vue components | :wrench: | :lipstick: |
| [vue/next-tick-style](./next-tick-style.md) | enforce Promise or callback style in `nextTick` | :wrench: | :hammer: |
| [vue/no-bare-strings-in-template](./no-bare-strings-in-template.md) | disallow the use of bare strings in `<template>` | | :hammer: |
| [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: | :hammer: |
| [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | | :hammer: |
| [vue/no-deprecated-model-definition](./no-deprecated-model-definition.md) | disallow deprecated `model` definition (in Vue.js 3.0.0+) | :bulb: | :warning: |
| [vue/no-duplicate-attr-inheritance](./no-duplicate-attr-inheritance.md) | enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"` | | :hammer: |
| [vue/no-empty-component-block](./no-empty-component-block.md) | disallow the `<template>` `<script>` `<style>` block to be empty | | :hammer: |
Expand Down
4 changes: 1 addition & 3 deletions docs/rules/no-boolean-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ since: v7.0.0

> disallow boolean defaults

- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

The rule prevents Boolean props from having a default value.

## :book: Rule Details

The rule is to enforce the HTML standard of always defaulting boolean attributes to false.

<eslint-code-block fix :rules="{'vue/no-boolean-default': ['error']}">
<eslint-code-block :rules="{'vue/no-boolean-default': ['error']}">

```vue
<script>
Expand Down
3 changes: 1 addition & 2 deletions docs/rules/no-deprecated-v-is.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ since: v7.11.0
> disallow deprecated `v-is` directive (in Vue.js 3.1.0+)

- :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `"plugin:vue/vue3-strongly-recommended"` and `"plugin:vue/vue3-recommended"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details

This rule reports deprecated `v-is` directive in Vue.js v3.1.0+.

Use [`is` attribute with `vue:` prefix](https://vuejs.org/api/built-in-special-attributes.html#is) instead.

<eslint-code-block fix :rules="{'vue/no-deprecated-v-is': ['error']}">
<eslint-code-block :rules="{'vue/no-deprecated-v-is': ['error']}">

```vue
<template>
Expand Down
1 change: 1 addition & 0 deletions eslint-internal-rules/no-invalid-meta-docs-categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ module.exports = {
description: 'enforce correct use of `meta` property in core rules',
categories: ['Internal']
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [],
messages: {
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ module.exports = [
'prefer-const': 2,

'prettier/prettier': 'error',
'eslint-plugin/require-meta-fixable': [
'error',
{ catchNoFixerButFixableProperty: true }
],
'eslint-plugin/report-message-format': ['error', "^[A-Z`'{].*\\.$"],

'no-debugger': 'error',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
categories: ['vue3-strongly-recommended', 'strongly-recommended'],
url: 'https://eslint.vuejs.org/rules/html-indent.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'whitespace',
schema: [
{
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-boolean-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/no-boolean-default.html'
},
fixable: 'code',
fixable: null,
schema: [
{
enum: ['default-false', 'no-default']
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-deprecated-scope-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
categories: ['vue3-essential'],
url: 'https://eslint.vuejs.org/rules/no-deprecated-scope-attribute.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [],
messages: {
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-deprecated-slot-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
categories: ['vue3-essential'],
url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-deprecated-slot-scope-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
categories: ['vue3-essential'],
url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [],
messages: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-v-is.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
categories: ['vue3-essential'],
url: 'https://eslint.vuejs.org/rules/no-deprecated-v-is.html'
},
fixable: 'code',
fixable: null,
schema: [],
messages: {
forbiddenVIs: '`v-is` directive is deprecated.'
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-unsupported-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/no-unsupported-features.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/padding-line-between-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/padding-line-between-blocks.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'whitespace',
schema: [
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/padding-line-between-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/padding-line-between-tags.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'whitespace',
schema: [
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/script-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/script-indent.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'whitespace',
schema: [
{
Expand Down
1 change: 1 addition & 0 deletions lib/rules/v-if-else-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ module.exports = {
recommended: false,
url: 'https://eslint.vuejs.org/rules/v-if-else-key.html'
},
// eslint-disable-next-line eslint-plugin/require-meta-fixable -- fixer is not recognized
fixable: 'code',
schema: [],
messages: {
Expand Down