Releases: vuejs/eslint-plugin-vue
Releases · vuejs/eslint-plugin-vue
v7.0.0
🚀 Highlight
- Support for Vue.js 3.0 "One Piece".
- Support for ESLint 7.x.
- Support for ECMAScript 2020.
- Added 66 new rules.
💥 Breaking Changes
- #1209 Change support version of ESLint from 6.0.0 to 6.2.0.
- Updated presets configs.
- Changed
plugin:vue/base
config. - Changed
plugin:vue/essential
config.- Same changes as above.
- #1036 Added
vue/valid-v-bind-sync
rule. - #1036 Added
vue/valid-v-slot
rule. - #1036 Added
vue/no-custom-modifiers-on-v-model
rule. - #1036 Added
vue/no-multiple-template-root
rule. - #1036 Added
vue/no-v-model-argument
rule. - #1148 Added
vue/no-mutating-props
rule. - #1156 Added
vue/no-arrow-functions-in-watch
rule. - #1166 Added
vue/custom-event-name-casing
rule. - #1239 Added
vue/no-dupe-v-else-if
rule. - #1281 Added
vue/no-v-for-template-key
rule.
- Changed
plugin:vue/strongly-recommended
config. - Changed
plugin:vue/recommended
config.
- Changed
- #1036 Changed
vue/name-property-casing
rule to be deprecate. - #1120 Added the support of descriptions in directive comments.
- #1120 Added the support for block-level directive comments.
- Changed the default order option for
vue/order-in-components
rule.- Add options for Vue.js 3.x.
- Add options for Vue.js 2.x.
- Add options for Vue Router.
- #1107 ROUTER_GUARDS (
beforeRouteEnter
,beforeRouteUpdate
andbeforeRouteLeave
) to afterprovide / inject
(provide / inject
was added aftermixins
).
- #1107 ROUTER_GUARDS (
- Add options for Nuxt.
- Change options for Nuxt.
✨ Enhancements
Core:
- #1120 Added the support of descriptions in directive comments.
- #1120 Added the support for block-level directive comments.
- #1073, #1088 Updated the rules of this plugin to detect Vue.js 3.x components.
- #1064 Updated the rules of this plugin to be able to analyze the arrow function component options.
- #1152 Changed casing conversion logic to behave like Vue core logic.
- Changed
plugin:vue/essential
config. - Changed
plugin:vue/strongly-recommended
config. - Changed
plugin:vue/recommended
config.
New Rulesets:
- Added
plugin:vue/vue3-essential
config. - Added
plugin:vue/vue3-strongly-recommended
config. - Added
plugin:vue/vue3-recommended
config.
New Rules:
for Vue.js 3.x:
- #1039 Added
vue/no-deprecated-v-bind-sync
rule that reports when deprecated.sync
modifier is used onv-bind
directive. Related to [RFC0005] - #1043 Added
vue/no-deprecated-filter
rule that reports usage of filters syntax removed in Vue.js 3.0.0+. Related to [RFC0015] - #1065 Added
vue/no-ref-as-operand
rule that reports cases where a ref is used incorrectly as an operand. Related to [RFC0013] - #1066 Added
vue/no-setup-props-destructure
rule that reports the destructuring of props passed to setup causing the value to lose reactivity. Related to [RFC0013] - #1067 Added
vue/no-lifecycle-after-await
rule that reports the lifecycle hooks after await expression. Related to [RFC0013] - #1079 Added
vue/no-deprecated-v-on-number-modifiers
rule that reports use of deprecatedKeyboardEvent.keyCode
modifier onv-on
directive. Related to [RFC0014] - #1083 Added
vue/no-deprecated-data-object-declaration
rule that reports use of deprecated object declaration ondata
property. Related to [RFC0019] - #1097 Added
vue/no-deprecated-events-api
rule that reports use of deprecated$on
,$off
and$once
api (removed in Vue.js v3.0.0+). Related to [RFC0020] - #1068 Added
vue/no-watch-after-await
rule that reports thewatch()
afterawait
expression. [RFC0013] - #1099, #1105 Added
vue/require-toggle-inside-transition
rule that reports elements inside<transition>
that do not control the display. Related to [RFC0017] - #1100 Added
vue/no-deprecated-inline-template
rule that reports deprecatedinline-template
attributes (removed in Vue.js v3.0.0+) Related to [RFC0016] - #1117 Added
vue/no-deprecated-html-element-is
rule that reports deprecated the is attribute on HTML elements (removed in Vue.js v3.0.0+). Related to [RFC0027] - #1118 Added
vue/no-deprecated-vue-config-keycodes
rule that reports use of deprecated Vue.config.keyCodes (removed in Vue.js 3.0.0+). Related to [RFC0014] - #1119 Added
vue/no-deprecated-functional-template
rule that reports deprecated the functional template (removed in Vue.js 3.0.0+). Related to [RFC0007] - #1124 Added
vue/require-explicit-emits
rule that reports event triggers not declared with the emits option. Related to [RFC0030] - #1129 Added
vue/return-in-emits-validator
rule enforces that a return statement is present in emits validators. Related to [RFC0030] - #1130 Added
vue/no-deprecated-v-on-native-modifier
rule that reports use of deprecated.native
modifier onv-on
directive. Related to [RFC0031] - #1133 Added
vue/no-deprecated-dollar-listeners-api
rule that reports use of deprecated$listeners
. Related to [RFC0031] - #1177 Added
vue/no-deprecated-dollar-scopedslots-api
rule that reports use of deprecated$scopedSlots
. Related to [RFC0006] - #1178 Added
vue/require-slots-as-functions
rule enforces the properties of $slots to be used as a function. Related to [RFC0006] - #1211 Added
vue/no-deprecated-destroyed-lifecycle
rule reports use of deprecateddestroyed
andbeforeDestroy
lifecycle hooks. - #1253 Added
vue/valid-v-is
rule that reports wrong usage ofv-is
directives. - #1289 Added
vue/no-v-for-template-key-on-child
rule that reports the key of the<template v-for>
placed on the child elements. - #1302 Added
vue/no-deprecated-props-default-this
rule that reports the use ofthis
within the props default value factory functions. - #1303 Added
vue/experimental-script-setup-vars
rule that prevent variables defined in<script setup>
to be marked as undefined.
for Vue.js 2.x:
- #1038 Added
vue/no-multiple-template-root
rule to template to check for a single root element. This rule has been separated from the previousvue/valid-template-root
rule. - #1039 Added
vue/no-v-model-argument
rule that does not allow argument to v-model. - #1039 Added
vue/no-custom-modifiers-on-v-model
rule that reports whenv-model
is used with custom modifiers on Vue Component. - #1281 Added
vue/no-v-for-template-key
rule that disallow the key placed on the<template v-for>
. This rule has been separated from the previousvue/no-template-key
rule.
Commons:
- #1086 Added
vue/no-template-no-target-blank
rule that disallows usingtarget="_blank"
attribute withoutrel="noopener noreferrer"
to avoid a security vulnerability. - #1114 Added
vue/no-unregistered-components
rule that disallow using components that are not registered inside templates. - #755 Added
vue/html-comment-indent
rule that enforce consistent indentation in HTML comments. - #755 Added
vue/html-comment-content-newline
rule that enforce unified line brake in HTML comments. - #755 Added
vue/html-comment-content-spacing
rule that enforce unified spacing in HTML comments. - #627 #1144 Added
vue/no-duplicate-attr-inheritance
rule that warn to applyinheritAttrs: false
when it detectsv-bind="$attrs"
being used. - #871 #1145 Added
vue/no-unused-properties
rule that report unused properties. - #633 #1148 Added
vue/no-mutating-props
rule that reports mutation of component props. - #671 Added
vue/one-component-per-file
rule that checks if there is only one component per file. - #1072 Added
vue/no-potential-property-typo
rule that disallow a potential typo in your component options. - #1155 Added
vue/no-arrow-functions-in-watch
rule that disallow use an arrow function to define a watcher. - #1166 Added
vue/custom-event-name-casing
rule that enforces using kebab-case custom event names. - #1179 Added
vue/no-multiple-slot-args
rule disallows to pass multiple arguments to scoped slots. - #1185 Added
vue/no-bare-strings-in-template
rule that disallows the use of bare strings in<template>
. - #1186 Added
vue/no-useless-v-bind
rule that reportsv-bind
with a string literal value. - #1187 Added
vue/no-useless-mustaches
rule that reports mustache interpolation with a string literal value. - #1191 Added
vue/no-restricted-v-bind
rule that disallow specific argument inv-bind
. - #1192 Added
vue/no-restricted-static-attribute
rule that disallow specific attribute. - #1213 Added
vue/no-restricted-component-options
rule that disallow specific component options. - #1218 Added
vue/no-multiple-objects-in-class
rule disallows to pass multiple objects into...
v7.0.0-beta.4
💥 Breaking Changes
- Changed
plugin:vue/base
config.- #1303 Added
vue/experimental-script-setup-vars
rule.
- #1303 Added
- Changed
plugin:vue/vue3-*
configs- #1302 Added
vue/no-deprecated-props-default-this
rule.
- #1302 Added
✨ Enhancements
New Rules:
- #1302 Added
vue/no-deprecated-props-default-this
rule that reports the use ofthis
within the props default value factory functions. - #1303 Added
vue/experimental-script-setup-vars
rule that prevent variables defined in<script setup>
to be marked as undefined.
All commits: v7.0.0-beta.3 -> v7.0.0-beta.4
v7.0.0-beta.3
💥 Breaking Changes
- Changed
plugin:vue/vue3-*
configs- #1289 Added
vue/no-v-for-template-key-on-child
rule.
- #1289 Added
✨ Enhancements
New Rules:
- #1281 Added
vue/no-v-for-template-key
rule that disallow the key placed on the<template v-for>
. (Separated fromvue/no-template-key
rule) - #1289 Added
vue/no-v-for-template-key-on-child
rule that reports the key of the<template v-for>
placed on the child elements.
⚙️ Updates
- #1281 Changed
vue/no-template-key
rule to allowv-for
key. - #1281 Added
vue/no-v-for-template-key
rule toplugin:vue/essential
config. - #1287 Changed
vue/valid-v-for
rule to not report when placing key on<template>
- #1287 Changed
vue/require-v-for-key
rule to not report when placing key on<template>
All commits: v7.0.0-beta.2 -> v7.0.0-beta.3
v7.0.0-beta.2
💥 Breaking Changes
- #1268 Changed the default order option for
vue/order-in-components
rule.- Change options for Nuxt
fetch
move from aftersetup
to afterdata
.
- Change options for Nuxt
All commits: v7.0.0-beta.1 -> v7.0.0-beta.2
v7.0.0-beta.1
✨ Enhancements
New Rules:
- #1267 Added
vue/v-for-delimiter-style
rule that enforces which delimiter (in
orof
) should be used inv-for
directives.
Other changes in Rules:
- #1259 Added
allowProps
option tovue/require-explicit-emits
rule.
🐛 Bug Fixes
- #1258 Fixed false negatives of "slot-scope" when "^3.0.0" is set in
vue/no-unsupported-features
rule. - #1262 Fixed reporting "Use the latest vue-eslint-parser" message in non-vue files.
All commits: v7.0.0-beta.0 -> v7.0.0-beta.1
v7.0.0-beta.0
💥 Breaking Changes
- #1209 Change supported version of ESLint from 6.0.0 to 6.2.0.
- Updated presets configs.
- #1209 Change presets configs
parserOptions.ecmaVersion
to 2020. - Changed
plugin:vue/vue3-essential
config- #1253 Added
vue/valid-v-is
rule.
- #1253 Added
- Changed
plugin:vue/vue3-strongly-recommended
config- Same changes as above.
- #1251 Added
vue/require-explicit-emits
rule.
- Changed
plugin:vue/vue3-recommended
config- Same changes as above.
- #1209 Change presets configs
✨ Enhancements
New Rules:
- #1253 Added
vue/valid-v-is
rule that reports wrong usage ofv-is
directives.
Other changes in Rules:
- #1209 Supports Optional Chaining (ES2020)
- #1254 Changed the
vue/attributes-order
rule to handlev-is
asDEFINITION
category. - #1254 Changed the
vue/no-unregistered-components
rule to handlev-is
like:is
. - #1254 Changed the
vue/no-unused-components
rule to handlev-is
like:is
. - #1254 Added
"v-is"
to the syntax checked by thevue/no-unsupported-features
rule.
🐛 Bug Fixes
- #1255 Fixed false positives for watch handler methods in
vue/no-unused-properties
rule.
All commits: v7.0.0-alpha.10 -> v7.0.0-beta.0
v7.0.0-alpha.10
💥 Breaking Changes
- Updated presets configs.
- Changed
plugin:vue/vue3-essential
config- #1239 Added
vue/no-dupe-v-else-if
rule.
- #1239 Added
- Changed
plugin:vue/vue3-strongly-recommended
config- Same changes as above.
- Changed
plugin:vue/vue3-recommended
config- Same changes as above.
- #1238 Added
vue/no-lone-template
rule.
- Changed
plugin:vue/essential
config- #1239 Added
vue/no-dupe-v-else-if
rule.
- #1239 Added
- Changed
plugin:vue/strongly-recommended
config- Same changes as above.
- Changed
plugin:vue/recommended
config- Same changes as above.
- #1238 Added
vue/no-lone-template
rule.
- #1237 Removed
jsx:true
from shareable configs.
- Changed
✨ Enhancements
New Rules:
- #1238 Added
vue/no-lone-template
rule that disallow unnecessary<template>
element. - #1239 Added
vue/no-dupe-v-else-if
rule that disallow duplicate conditions inv-if
/v-else-if
chains. - #1243 Added
vue/no-sparse-arrays
rule that appliesno-sparse-arrays
rule to expressions in<template>
.
Other changes in Rules:
- #1225 Changed
vue/no-ref-as-operand
to also checkref
of@vue/composition-api
.
🐛 Bug Fixes
- #1242 Fixed
vue/no-unused-properties
,vue/require-valid-default-prop
,vue/require-default-prop
andvue/no-multiple-objects-in-class
rules crash on sparse arrays.
⚙️ Updates
- #1237 Removed
jsx:true
from shareable configs.
All commits: v7.0.0-alpha.9 -> v7.0.0-alpha.10
v7.0.0-alpha.9
🐛 Bug Fixes
- #1232 Fixed crash when using
vue/no-empty-component-block
andvue/padding-line-between-blocks
rules in.js
file
All commits: v7.0.0-alpha.8 -> v7.0.0-alpha.9
v7.0.0-alpha.8
🐛 Bug Fixes
- #1226 #1227 Fixed crash in the
vue/no-side-effects-in-computed-properties
,vue/no-async-in-computed-properties
,vue/no-setup-props-destructure
andvue/no-watch-after-await
rules.
All commits: v7.0.0-alpha.7 -> v7.0.0-alpha.8
v7.0.0-alpha.7
💥 Breaking Changes
- Updated presets configs.
- Changed
plugin:vue/vue3-essential
config- #1211 Added
vue/no-deprecated-destroyed-lifecycle
rule.
- #1211 Added
- Changed
plugin:vue/vue3-strongly-recommended
config- Same changes as above.
- Changed
plugin:vue/vue3-recommended
config- Same changes as above.
- Changed
- #1107 Changed the default order option for
vue/order-in-components
rule. Add Nuxt and Vue Router properties.- Add options for Vue Router
- ROUTER_GUARDS (
beforeRouteEnter
,beforeRouteUpdate
andbeforeRouteLeave
) to after["provide", "inject"]
.
- ROUTER_GUARDS (
- Add options for Nuxt
key
to aftername
.layout
,middleware
,validate
,scrollToTop
,transition
,loading
to after ROUTER_GUARDS (ROUTER_GUARDS was added after["provide", "inject"]
).watchQuery
to afterwatch
.
- Change options for Nuxt
head
move from aftermethods
to afterdata
.
- Add options for Vue Router
- #1214 Change the option name in the
vue/no-bare-strings-in-template
rule.
✨ Enhancements
New Rules:
- #1211 Added
vue/no-deprecated-destroyed-lifecycle
rule reports use of deprecateddestroyed
andbeforeDestroy
lifecycle hooks. - #1213 Added
vue/no-restricted-component-options
rule that disallow specific component options. - #1218 Added
vue/no-multiple-objects-in-class
rule disallows to pass multiple objects into array to class. - #1222 Added
vue/no-empty-component-block
rule disallows the<template>
<script>
<style>
block to be empty.
Other changes in Rules:
- #1204 Added
ignoreIncludesComment
option tovue/v-on-function-call
rule. - #1017 Added supports for ES2020 syntaxes to
vue/html-indent
andvue/script-indent
rules. - #1212 Added
"v-model-argument"
and"v-model-custom-modifiers"
to the syntax checked by thevue/no-unsupported-features
rule.
🐛 Bug Fixes
- #1204 Fixed wrong autofix in
vue/v-on-function-call
rule. - #1208 Fixed false negatives for TemplateLiteral in
vue/prop-name-casing
rule. - #1206 Fixed crash when
is
attribute with no value invue/no-unused-components
rule.
⚙️ Chores
- #1206 Added JSDoc type checking with TypeScript, and refactoring.
All commits: v7.0.0-alpha.6 -> v7.0.0-alpha.7