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/baseconfig. - Changed
plugin:vue/essentialconfig.- Same changes as above.
- #1036 Added
vue/valid-v-bind-syncrule. - #1036 Added
vue/valid-v-slotrule. - #1036 Added
vue/no-custom-modifiers-on-v-modelrule. - #1036 Added
vue/no-multiple-template-rootrule. - #1036 Added
vue/no-v-model-argumentrule. - #1148 Added
vue/no-mutating-propsrule. - #1156 Added
vue/no-arrow-functions-in-watchrule. - #1166 Added
vue/custom-event-name-casingrule. - #1239 Added
vue/no-dupe-v-else-ifrule. - #1281 Added
vue/no-v-for-template-keyrule.
- Changed
plugin:vue/strongly-recommendedconfig. - Changed
plugin:vue/recommendedconfig.
- Changed
- #1036 Changed
vue/name-property-casingrule 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-componentsrule.- Add options for Vue.js 3.x.
- Add options for Vue.js 2.x.
- Add options for Vue Router.
- #1107 ROUTER_GUARDS (
beforeRouteEnter,beforeRouteUpdateandbeforeRouteLeave) to afterprovide / inject(provide / injectwas 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/essentialconfig. - Changed
plugin:vue/strongly-recommendedconfig. - Changed
plugin:vue/recommendedconfig.
New Rulesets:
- Added
plugin:vue/vue3-essentialconfig. - Added
plugin:vue/vue3-strongly-recommendedconfig. - Added
plugin:vue/vue3-recommendedconfig.
New Rules:
for Vue.js 3.x:
- #1039 Added
vue/no-deprecated-v-bind-syncrule that reports when deprecated.syncmodifier is used onv-binddirective. Related to RFC0005 - #1043 Added
vue/no-deprecated-filterrule that reports usage of filters syntax removed in Vue.js 3.0.0+. Related to RFC0015 - #1065 Added
vue/no-ref-as-operandrule that reports cases where a ref is used incorrectly as an operand. Related to RFC0013 - #1066 Added
vue/no-setup-props-destructurerule that reports the destructuring of props passed to setup causing the value to lose reactivity. Related to RFC0013 - #1067 Added
vue/no-lifecycle-after-awaitrule that reports the lifecycle hooks after await expression. Related to RFC0013 - #1079 Added
vue/no-deprecated-v-on-number-modifiersrule that reports use of deprecatedKeyboardEvent.keyCodemodifier onv-ondirective. Related to RFC0014 - #1083 Added
vue/no-deprecated-data-object-declarationrule that reports use of deprecated object declaration ondataproperty. Related to RFC0019 - #1097 Added
vue/no-deprecated-events-apirule that reports use of deprecated$on,$offand$onceapi (removed in Vue.js v3.0.0+). Related to RFC0020 - #1068 Added
vue/no-watch-after-awaitrule that reports thewatch()afterawaitexpression. RFC0013 - #1099, #1105 Added
vue/require-toggle-inside-transitionrule that reports elements inside<transition>that do not control the display. Related to RFC0017 - #1100 Added
vue/no-deprecated-inline-templaterule that reports deprecatedinline-templateattributes (removed in Vue.js v3.0.0+) Related to RFC0016 - #1117 Added
vue/no-deprecated-html-element-isrule 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-keycodesrule that reports use of deprecated Vue.config.keyCodes (removed in Vue.js 3.0.0+). Related to RFC0014 - #1119 Added
vue/no-deprecated-functional-templaterule that reports deprecated the functional template (removed in Vue.js 3.0.0+). Related to RFC0007 - #1124 Added
vue/require-explicit-emitsrule that reports event triggers not declared with the emits option. Related to RFC0030 - #1129 Added
vue/return-in-emits-validatorrule enforces that a return statement is present in emits validators. Related to RFC0030 - #1130 Added
vue/no-deprecated-v-on-native-modifierrule that reports use of deprecated.nativemodifier onv-ondirective. Related to RFC0031 - #1133 Added
vue/no-deprecated-dollar-listeners-apirule that reports use of deprecated$listeners. Related to RFC0031 - #1177 Added
vue/no-deprecated-dollar-scopedslots-apirule that reports use of deprecated$scopedSlots. Related to RFC0006 - #1178 Added
vue/require-slots-as-functionsrule enforces the properties of $slots to be used as a function. Related to RFC0006 - #1211 Added
vue/no-deprecated-destroyed-lifecyclerule reports use of deprecateddestroyedandbeforeDestroylifecycle hooks. - #1253 Added
vue/valid-v-isrule that reports wrong usage ofv-isdirectives. - #1289 Added
vue/no-v-for-template-key-on-childrule that reports the key of the<template v-for>placed on the child elements. - #1302 Added
vue/no-deprecated-props-default-thisrule that reports the use ofthiswithin the props default value factory functions. - #1303 Added
vue/experimental-script-setup-varsrule that prevent variables defined in<script setup>to be marked as undefined.
for Vue.js 2.x:
- #1038 Added
vue/no-multiple-template-rootrule to template to check for a single root element. This rule has been separated from the previousvue/valid-template-rootrule. - #1039 Added
vue/no-v-model-argumentrule that does not allow argument to v-model. - #1039 Added
vue/no-custom-modifiers-on-v-modelrule that reports whenv-modelis used with custom modifiers on Vue Component. - #1281 Added
vue/no-v-for-template-keyrule that disallow the key placed on the<template v-for>. This rule has been separated from the previousvue/no-template-keyrule.
Commons:
- #1086 Added
vue/no-template-no-target-blankrule that disallows usingtarget="_blank"attribute withoutrel="noopener noreferrer"to avoid a security vulnerability. - #1114 Added
vue/no-unregistered-componentsrule that disallow using components that are not registered inside templates. - #755 Added
vue/html-comment-indentrule that enforce consistent indentation in HTML comments. - #755 Added
vue/html-comment-content-newlinerule that enforce unified line brake in HTML comments. - #755 Added
vue/html-comment-content-spacingrule that enforce unified spacing in HTML comments. - #627 #1144 Added
vue/no-duplicate-attr-inheritancerule that warn to applyinheritAttrs: falsewhen it detectsv-bind="$attrs"being used. - #871 #1145 Added
vue/no-unused-propertiesrule that report unused properties. - #633 #1148 Added
vue/no-mutating-propsrule that reports mutation of component props. - #671 Added
vue/one-component-per-filerule that checks if there is only one component per file. - #1072 Added
vue/no-potential-property-typorule that disallow a potential typo in your component options. - #1155 Added
vue/no-arrow-functions-in-watchrule that disallow use an arrow function to define a watcher. - #1166 Added
vue/custom-event-name-casingrule that enforces using kebab-case custom event names. - #1179 Added
vue/no-multiple-slot-argsrule disallows to pass multiple arguments to scoped slots. - #1185 Added
vue/no-bare-strings-in-templaterule that disallows the use of bare strings in<template>. - #1186 Added
vue/no-useless-v-bindrule that reportsv-bindwith a string literal value. - #1187 Added
vue/no-useless-mustachesrule that reports mustache interpolation with a string literal value. - #1191 Added
vue/no-restricted-v-bindrule that disallow specific argument inv-bind. - #1192 Added
vue/no-restricted-static-attributerule that disallow specific attribute. - #1213 Added
vue/no-restricted-component-optionsrule that disallow specific component options. - #1218 Added
vue/no-multiple-objects-in-classrule disallows to pass multiple objects into array to class. - #1222 Added
vue/no-empty-component-blockrule disallows the<template><script><style>block to be empty. - #1238 Added
vue/no-lone-templaterule that disallow unnecessary<template>element. - #1239 Added
vue/no-dupe-v-else-ifrule that disallow duplicate conditions inv-if/v-else-ifchains. - #1267 Added
vue/v-for-delimiter-stylerule that enforces which delimiter (inorof) should be used inv-fordirectives.
Core Extends:
- #1140 Added
vue/comma-spacingrule that appliescomma-spacingrule to expressions in<template>. - #1141 Added
vue/prefer-templaterule that appliesprefer-templaterule to expressions in<template>. - #1142 Added
vue/template-curly-spacingrule that appliestemplate-curly-spacingrule to expressions in<template>. - #1157 Added
vue/space-in-parensrule that appliesspace-in-parensrule to expressions in<template>. - #1159 Added
vue/comma-stylerule that appliescomma-stylerule to expressions in<template>. - #1158 Added
vue/no-extra-parensrule that appliesno-extra-parensrule to expressions in<template>. - #1171 Added
vue/no-useless-concatrule that appliesno-useless-concatrule to expressions in<template>. - #1173 Added
vue/dot-notationrule that appliesdot-notationrule to expressions in<template>. - #1193 Added
vue/object-property-newlinerule that appliesobject-property-newlinerule to expressions in<template>. - #1194 Added
vue/object-curly-newlinerule that appliesobject-curly-newlinerule to expressions in<template>. - #1200 Added
vue/operator-linebreakrule that appliesoperator-linebreakrule to expressions in<template>. - #1201 Added
vue/func-call-spacingrule that appliesfunc-call-spacingrule to expressions in<template>. - #1243 Added
vue/no-sparse-arraysrule that appliesno-sparse-arraysrule to expressions in<template>.
New Options:
- #1070 Added
ignorePatternoption tovue/no-unsed-varsrule to disables reporting of variable names that match the regular expression. - #1116 Added
disallowVueBuiltInComponentsanddisallowVue3BuiltInComponentsoption that reports Vue built-in component names to thevue/no-reserved-component-namesrule. - #1167 Added
reportUnusedDisableDirectivesoption tovue/comment-directive. - #1162 Added
closeBracket.startTag,closeBracket.endTagandcloseBracket.selfClosingTagoptions tovue/html-indentrule.
So that the closeBracket offset value can be set for each tag type. - #1204 Added
ignoreIncludesCommentoption tovue/v-on-function-callrule. - #1212 Added
"v-model-argument"and"v-model-custom-modifiers"to the syntax checked by thevue/no-unsupported-featuresrule. - #1254 Added
"v-is"to the syntax checked by thevue/no-unsupported-featuresrule.
Other Changes in Rules:
for Vue.js 3.x:
- #1038 Changed to remove a single root element check from
vue/valid-template-rootrule. - #1039 Changed
vue/valid-v-modelrule to allowv-modelargument. Related to RFC0011 - #1039 Changed
vue/valid-v-modelrule to allowv-modelcustom modifiers. Related to RFC0011 - #1082 Changed
vue/no-dupe-key,vue/no-reserved-keysrules to handlesetup. - #1199 Changed
vue/require-direct-exportrule to allow Vue 3 functional component. - #1181 Added the Vue.js 3.x options to the default order option for
vue/order-in-componentsrule. - #1254 Changed the
vue/attributes-orderrule to handlev-isasDEFINITIONcategory. - #1254 Changed the
vue/no-unregistered-componentsrule to handlev-islike:is. - #1254 Changed the
vue/no-unused-componentsrule to handlev-islike:is. - #1258 Changed to report
slot-scopewhen"^3.0.0"is set invue/no-unsupported-featuresrule. - #1281 Changed
vue/no-template-keyrule to allowv-forkey. - #1287 Changed
vue/valid-v-forrule to not report when placing key on<template>. - #1287 Changed
vue/require-v-for-keyrule to not report when placing key on<template>.
Commons:
- #1036 Changed
vue/name-property-casingrule to be deprecate. - #1154 Changed
vue/no-side-effects-in-computed-propertiesrule to track thethisvariable. - #1160 Changed
vue/require-valid-default-proprule to track thereturnstatement in thefunctiondefined indefault. - #1160 Changed
vue/require-valid-default-proprule to checkBigInt. - #1160 Improved the location of reporting errors in
vue/require-valid-default-proprule. - #1162 Changed
vue/html-indentrule to calculate the base point of the indent offset of the closing bracket of the end tag by the start tag. - #1183 Improved autofix of
vue/order-in-componentsrule to understand "Nullish Coalescing". - #1184 Changed to not report that a value is required when parsing error for
vue/valid-v-bind-sync,vue/valid-v-bind,vue/valid-v-else-if,vue/valid-v-for,vue/valid-v-html,vue/valid-v-if,vue/valid-v-model,vue/valid-v-on,vue/valid-v-show,vue/valid-v-slotandvue/valid-v-textrules. - #1189 Changed
vue/component-tags-orderrule to allow name array to be specified with one order option. - #1189 Changed the default order option for
vue/component-tags-orderrule. - #1107 Added Nuxt and Vue Router properties to the default order option.
- #1181, #1107 Changed the default order option for
vue/order-in-componentsrule. - #1017 Added supports for ES2020 syntaxes to
vue/html-indentandvue/script-indentrules. - #1209 Added supports for Optional Chaining (ES2020) to rules.
π Bug Fixes
- #1146 Fixed false positives for member call and autofix error in
vue/v-on-function-callrule. - #1152 Fixed some casing issues.
- #1164 Fixed false negatives when
v-forandv-slotmixed or use destructuring forvue/no-unused-varrule. - #1190 Fixed false positives for getter/setter in
vue/no-dupe-keysrule. - #1204 Fixed wrong autofix in
vue/v-on-function-callrule. - #1208 Fixed false negatives for TemplateLiteral in
vue/prop-name-casingrule. - #1206 Fixed crash when
isattribute with no value invue/no-unused-componentsrule. - #1242 Fixed
vue/require-valid-default-propandvue/require-default-proprules crash on sparse arrays. - #1262 Fixed reporting "Use the latest vue-eslint-parser" message in non-vue files.
- #1154 #1283 Fixed false positives for spread elements in
vue/no-side-effects-in-computedrule.
All commits: v6.2.2 -> v7.0.0