|
| 1 | +## :rocket: Highlight |
| 2 | + |
| 3 | +- Support for Vue.js 3.x. |
| 4 | +- Support for ESLint 7.x. |
| 5 | +- Support for ECMAScript 2020. |
| 6 | +- Added 61 new rules. |
| 7 | + |
| 8 | +## π₯ Breaking Changes |
| 9 | + |
| 10 | +- #1209 Change support version of ESLint from 6.0.0 to 6.2.0. |
| 11 | +- Updated presets configs. |
| 12 | + - Changed `plugin:vue/base` config. |
| 13 | + - #1237 Removed `jsx:true` from shareable configs. |
| 14 | + - #1209 Changed `parserOptions.ecmaVersion` to 2020. |
| 15 | + - Changed `plugin:vue/essential` config. |
| 16 | + - Same changes as above. |
| 17 | + - #1036 Added `vue/valid-v-bind-sync` rule. |
| 18 | + - #1036 Added `vue/valid-v-slot` rule. |
| 19 | + - #1036 Added `vue/no-custom-modifiers-on-v-model` rule. |
| 20 | + - #1036 Added `vue/no-multiple-template-root` rule. |
| 21 | + - #1036 Added `vue/no-v-model-argument` rule. |
| 22 | + - #1148 Added `vue/no-mutating-props` rule. |
| 23 | + - #1156 Added `vue/no-arrow-functions-in-watch` rule. |
| 24 | + - #1166 Added `vue/custom-event-name-casing` rule. |
| 25 | + - #1239 Added `vue/no-dupe-v-else-if` rule. |
| 26 | + - Changed `plugin:vue/strongly-recommended` config. |
| 27 | + - Same changes as above. |
| 28 | + - #1036 Added `vue/component-definition-name-casing` rule. |
| 29 | + - #1036 Added `vue/v-slot-style` rule. |
| 30 | + - #1036 Removed `vue/name-property-casing` rule. |
| 31 | + - #1149 Added `vue/one-component-per-file` rule. |
| 32 | + - Changed `plugin:vue/recommended` config. |
| 33 | + - Same changes as above. |
| 34 | + - #1036 Added `vue/component-tags-order` rule. |
| 35 | + - #1179 Added `vue/no-multiple-slot-args` rule. |
| 36 | + - #1238 Added `vue/no-lone-template` rule. |
| 37 | +- #1036 Changed `vue/name-property-casing` rule to be deprecate. |
| 38 | +- #1120 Added the support of descriptions in directive comments. |
| 39 | +- #1120 Added the support for block-level directive comments. |
| 40 | +- Changed the default order option for `vue/order-in-components` rule. |
| 41 | + - Add options for Vue.js 3.x. |
| 42 | + - #1181 `emits` to after `props`. |
| 43 | + - #1181 `setup` to after `emits`. |
| 44 | + - #1181 `beforeUnmount` and `unmounted` to LIFECYCLE_HOOKS. |
| 45 | + - #1181 `renderTracked` and `renderTriggered` to LIFECYCLE_HOOKS. |
| 46 | + - Add options for Vue.js 2.x. |
| 47 | + - #1181 `provide` and `inject` to after `mixins`. |
| 48 | + - #1181 `errorCaptured` to LIFECYCLE_HOOKS. |
| 49 | + - Add options for Vue Router. |
| 50 | + - #1107 ROUTER_GUARDS (`beforeRouteEnter`, `beforeRouteUpdate` and `beforeRouteLeave`) to after `provide / inject` (`provide / inject` was added after `mixins`). |
| 51 | + - Add options for Nuxt. |
| 52 | + - #1107 `key` to after `name`. |
| 53 | + - #1107 `layout`, `middleware`, `validate`, `scrollToTop`, `transition`, `loading` to after ROUTER_GUARDS (ROUTER_GUARDS was added after `provide / inject`). |
| 54 | + - #1107 `watchQuery` to after `watch`. |
| 55 | + - Change options for Nuxt. |
| 56 | + - #1107 `head` move from after `methods` to after `data`. |
| 57 | + |
| 58 | +## β¨ Enhancements |
| 59 | + |
| 60 | +### Core: |
| 61 | + |
| 62 | +- #1120 Added the support of descriptions in directive comments. |
| 63 | +- #1120 Added the support for block-level directive comments. |
| 64 | +- #1073, #1088 Updated the rules of this plugin to detect Vue.js 3.x components. |
| 65 | +- #1064 Updated the rules of this plugin to be able to analyze the arrow function component options. |
| 66 | +- #1152 Changed casing conversion logic to behave like Vue core logic. |
| 67 | +- Changed `plugin:vue/essential` config. |
| 68 | +- Changed `plugin:vue/strongly-recommended` config. |
| 69 | +- Changed `plugin:vue/recommended` config. |
| 70 | + |
| 71 | +### New Rulesets: |
| 72 | + |
| 73 | +- Added `plugin:vue/vue3-essential` config. |
| 74 | +- Added `plugin:vue/vue3-strongly-recommended` config. |
| 75 | +- Added `plugin:vue/vue3-recommended` config. |
| 76 | + |
| 77 | +### New Rules: |
| 78 | + |
| 79 | +#### for Vue.js 3.x: |
| 80 | + |
| 81 | +- #1039 Added `vue/no-deprecated-v-bind-sync` rule that reports when deprecated `.sync` modifier is used on `v-bind` directive. Related to [RFC0005] |
| 82 | +- #1043 Added `vue/no-deprecated-filter` rule that reports usage of filters syntax removed in Vue.js 3.0.0+. Related to [RFC0015] |
| 83 | +- #1065 Added `vue/no-ref-as-operand` rule that reports cases where a ref is used incorrectly as an operand. Related to [RFC0013] |
| 84 | +- #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] |
| 85 | +- #1067 Added `vue/no-lifecycle-after-await` rule that reports the lifecycle hooks after await expression. Related to [RFC0013] |
| 86 | +- #1079 Added `vue/no-deprecated-v-on-number-modifiers` rule that reports use of deprecated `KeyboardEvent.keyCode` modifier on `v-on` directive. Related to [RFC0014] |
| 87 | +- #1083 Added `vue/no-deprecated-data-object-declaration` rule that reports use of deprecated object declaration on `data` property. Related to [RFC0019] |
| 88 | +- #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] |
| 89 | +- #1068 Added `vue/no-watch-after-await` rule that reports the `watch()` after `await` expression. [RFC0013] |
| 90 | +- #1099, #1105 Added `vue/require-toggle-inside-transition` rule that reports elements inside `<transition>` that do not control the display. Related to [RFC0017] |
| 91 | +- #1100 Added `vue/no-deprecated-inline-template` rule that reports deprecated `inline-template` attributes (removed in Vue.js v3.0.0+) Related to [RFC0016] |
| 92 | +- #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] |
| 93 | +- #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] |
| 94 | +- #1119 Added `vue/no-deprecated-functional-template` rule that reports deprecated the functional template (removed in Vue.js 3.0.0+). Related to [RFC0007] |
| 95 | +- #1124 Added `vue/require-explicit-emits` rule that reports event triggers not declared with the emits option. Related to [RFC0030] |
| 96 | +- #1129 Added `vue/return-in-emits-validator` rule enforces that a return statement is present in emits validators. Related to [RFC0030] |
| 97 | +- #1130 Added `vue/no-deprecated-v-on-native-modifier` rule that reports use of deprecated `.native` modifier on `v-on` directive. Related to [RFC0031] |
| 98 | +- #1133 Added `vue/no-deprecated-dollar-listeners-api` rule that reports use of deprecated `$listeners`. Related to [RFC0031] |
| 99 | +- #1177 Added `vue/no-deprecated-dollar-scopedslots-api` rule that reports use of deprecated `$scopedSlots`. Related to [RFC0006] |
| 100 | +- #1178 Added `vue/require-slots-as-functions` rule enforces the properties of $slots to be used as a function. Related to [RFC0006] |
| 101 | +- #1211 Added `vue/no-deprecated-destroyed-lifecycle` rule reports use of deprecated `destroyed` and `beforeDestroy` lifecycle hooks. |
| 102 | +- #1253 Added `vue/valid-v-is` rule that reports wrong usage of `v-is` directives. |
| 103 | + |
| 104 | +#### for Vue.js 2.x: |
| 105 | + |
| 106 | +- #1038 Added `vue/no-multiple-template-root` rule to template to check for a single root element. This rule has been separated from the previous `vue/valid-template-root`. |
| 107 | +- #1039 Added `vue/no-v-model-argument` rule that does not allow argument to v-model. |
| 108 | +- #1039 Added `vue/no-custom-modifiers-on-v-model` rule that reports when `v-model` is used with custom modifiers on Vue Component. |
| 109 | + |
| 110 | +#### Commons: |
| 111 | + |
| 112 | +- #1086 Added `vue/no-template-no-target-blank` rule that disallows using `target="_blank"` attribute without `rel="noopener noreferrer"` to avoid a security vulnerability. |
| 113 | +- #1114 Added `vue/no-unregistered-components` rule that disallow using components that are not registered inside templates. |
| 114 | +- #755 Added `vue/html-comment-indent` rule that enforce consistent indentation in HTML comments. |
| 115 | +- #755 Added `vue/html-comment-content-newline` rule that enforce unified line brake in HTML comments. |
| 116 | +- #755 Added `vue/html-comment-content-spacing` rule that enforce unified spacing in HTML comments. |
| 117 | +- #627 #1144 Added `vue/no-duplicate-attr-inheritance` rule that warn to apply `inheritAttrs: false` when it detects `v-bind="$attrs"` being used. |
| 118 | +- #871 #1145 Added `vue/no-unused-properties` rule that report unused properties. |
| 119 | +- #633 #1148 Added `vue/no-mutating-props` rule that reports mutation of component props. |
| 120 | +- #671 Added `vue/one-component-per-file` rule that checks if there is only one component per file. |
| 121 | +- #1072 Added `vue/no-potential-property-typo` rule that disallow a potential typo in your component options. |
| 122 | +- #1155 Added `vue/no-arrow-functions-in-watch` rule that disallow use an arrow function to define a watcher. |
| 123 | +- #1166 Added `vue/custom-event-name-casing` rule that enforces using kebab-case custom event names. |
| 124 | +- #1179 Added `vue/no-multiple-slot-args` rule disallows to pass multiple arguments to scoped slots. |
| 125 | +- #1185 Added `vue/no-bare-strings-in-template` rule that disallows the use of bare strings in `<template>`. |
| 126 | +- #1186 Added `vue/no-useless-v-bind` rule that reports `v-bind` with a string literal value. |
| 127 | +- #1187 Added `vue/no-useless-mustaches` rule that reports mustache interpolation with a string literal value. |
| 128 | +- #1191 Added `vue/no-restricted-v-bind` rule that disallow specific argument in `v-bind`. |
| 129 | +- #1192 Added `vue/no-restricted-static-attribute` rule that disallow specific attribute. |
| 130 | +- #1213 Added `vue/no-restricted-component-options` rule that disallow specific component options. |
| 131 | +- #1218 Added `vue/no-multiple-objects-in-class` rule disallows to pass multiple objects into array to class. |
| 132 | +- #1222 Added `vue/no-empty-component-block` rule disallows the `<template>` `<script>` `<style>` block to be empty. |
| 133 | +- #1238 Added `vue/no-lone-template` rule that disallow unnecessary `<template>` element. |
| 134 | +- #1239 Added `vue/no-dupe-v-else-if` rule that disallow duplicate conditions in `v-if` / `v-else-if` chains. |
| 135 | + |
| 136 | +#### Core Extends: |
| 137 | + |
| 138 | +- #1140 Added `vue/comma-spacing` rule that applies `comma-spacing` rule to expressions in `<template>`. |
| 139 | +- #1141 Added `vue/prefer-template` rule that applies `prefer-template` rule to expressions in `<template>`. |
| 140 | +- #1142 Added `vue/template-curly-spacing` rule that applies `template-curly-spacing` rule to expressions in `<template>`. |
| 141 | +- #1157 Added `vue/space-in-parens` rule that applies `space-in-parens` rule to expressions in `<template>`. |
| 142 | +- #1159 Added `vue/comma-style` rule that applies `comma-style` rule to expressions in `<template>`. |
| 143 | +- #1158 Added `vue/no-extra-parens` rule that applies `no-extra-parens` rule to expressions in `<template>`. |
| 144 | +- #1171 Added `vue/no-useless-concat` rule that applies `no-useless-concat` rule to expressions in `<template>`. |
| 145 | +- #1173 Added `vue/dot-notation` rule that applies `dot-notation` rule to expressions in `<template>`. |
| 146 | +- #1193 Added `vue/object-property-newline` rule that applies `object-property-newline` rule to expressions in `<template>`. |
| 147 | +- #1194 Added `vue/object-curly-newline` rule that applies `object-curly-newline` rule to expressions in `<template>`. |
| 148 | +- #1200 Added `vue/operator-linebreak` rule that applies `operator-linebreak` rule to expressions in `<template>`. |
| 149 | +- #1201 Added `vue/func-call-spacing` rule that applies `func-call-spacing` rule to expressions in `<template>`. |
| 150 | +- #1243 Added `vue/no-sparse-arrays` rule that applies `no-sparse-arrays` rule to expressions in `<template>`. |
| 151 | + |
| 152 | +### New Options: |
| 153 | + |
| 154 | +- #1070 Added `ignorePattern` option to `vue/no-unsed-vars` rule to disables reporting of variable names that match the regular expression. |
| 155 | +- #1116 Added `disallowVueBuiltInComponents` and `disallowVue3BuiltInComponents` option that reports Vue built-in component names to the `vue/no-reserved-component-names` rule. |
| 156 | +- #1167 Added `reportUnusedDisableDirectives` option to `vue/comment-directive`. |
| 157 | +- #1162 Added `closeBracket.startTag`, `closeBracket.endTag` and `closeBracket.selfClosingTag` options to `vue/html-indent` rule. |
| 158 | + So that the closeBracket offset value can be set for each tag type. |
| 159 | +- #1204 Added `ignoreIncludesComment` option to `vue/v-on-function-call` rule. |
| 160 | +- #1212 Added `"v-model-argument"` and `"v-model-custom-modifiers"` to the syntax checked by the `vue/no-unsupported-features` rule. |
| 161 | +- #1254 Added `"v-is"` to the syntax checked by the `vue/no-unsupported-features` rule. |
| 162 | + |
| 163 | +### Other Changes in Rules: |
| 164 | + |
| 165 | +#### for Vue.js 3.x: |
| 166 | + |
| 167 | +- #1038 Changed to remove a single root element check from `vue/valid-template-root` rule. |
| 168 | +- #1039 Changed `vue/valid-v-model` rule to allow `v-model` argument. Related to [RFC0011] |
| 169 | +- #1039 Changed `vue/valid-v-model` rule to allow `v-model` custom modifiers. Related to [RFC0011] |
| 170 | +- #1082 Changed `vue/no-dupe-key`, `vue/no-reserved-keys` rules to handle `setup`. |
| 171 | +- #1199 Changed `vue/require-direct-export` rule to allow Vue 3 functional component. |
| 172 | +- #1181 Added the Vue.js 3.x options to the default order option for `vue/order-in-components` rule. |
| 173 | +- #1254 Changed the `vue/attributes-order` rule to handle `v-is` as `DEFINITION` category. |
| 174 | +- #1254 Changed the `vue/no-unregistered-components` rule to handle `v-is` like `:is`. |
| 175 | +- #1254 Changed the `vue/no-unused-components` rule to handle `v-is` like `:is`. |
| 176 | + |
| 177 | +#### Commons: |
| 178 | + |
| 179 | +- #1036 Changed `vue/name-property-casing` rule to be deprecate. |
| 180 | +- #1154 Changed `vue/no-side-effects-in-computed-properties` rule to track the `this` variable. |
| 181 | +- #1160 Changed `vue/require-valid-default-prop` rule to track the `return` statement in the `function` defined in `default`. |
| 182 | +- #1160 Changed `vue/require-valid-default-prop` rule to check `BigInt`. |
| 183 | +- #1160 Improved the location of reporting errors in `vue/require-valid-default-prop` rule. |
| 184 | +- #1162 Changed `vue/html-indent` rule to calculate the base point of the indent offset of the closing bracket of the end tag by the start tag. |
| 185 | +- #1183 Improved autofix of `vue/order-in-components` rule to understand "Nullish Coalescing". |
| 186 | +- #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-slot` and `vue/valid-v-text` rules. |
| 187 | +- #1189 Changed `vue/component-tags-order` rule to allow name array to be specified with one order option. |
| 188 | +- #1189 Changed the default order option for `vue/component-tags-order` rule. |
| 189 | +- #1107 Added Nuxt and Vue Router properties to the default order option. |
| 190 | +- #1181, #1107 Changed the default order option for `vue/order-in-components` rule. |
| 191 | +- #1017 Added supports for ES2020 syntaxes to `vue/html-indent` and `vue/script-indent` rules. |
| 192 | +- #1209 Added supports for Optional Chaining (ES2020) to rules. |
| 193 | + |
| 194 | +## π Bug Fixes |
| 195 | + |
| 196 | +- #1146 Fixed false positives for member call and autofix error in `vue/v-on-function-call` rule. |
| 197 | +- #1152 Fixed some casing issues. |
| 198 | +- #1164 Fixed false negatives when `v-for` and `v-slot` mixed or use destructuring for `vue/no-unused-var` rule. |
| 199 | +- #1190 Fixed false positives for getter/setter in `vue/no-dupe-keys` rule. |
| 200 | +- #1204 Fixed wrong autofix in `vue/v-on-function-call` rule. |
| 201 | +- #1208 Fixed false negatives for TemplateLiteral in `vue/prop-name-casing` rule. |
| 202 | +- #1206 Fixed crash when `is` attribute with no value in `vue/no-unused-components` rule. |
| 203 | +- #1242 Fixed `vue/require-valid-default-prop` and `vue/require-default-prop` rules crash on sparse arrays. |
| 204 | + |
| 205 | +---- |
| 206 | + |
| 207 | +**All commits:** [v6.2.2 -> v7.0.0](https://github.com/vuejs/eslint-plugin-vue/compare/v6.2.2...v7.0.0) |
| 208 | + |
| 209 | +[RFC0005]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0005-replace-v-bind-sync-with-v-model-argument.md |
| 210 | +[RFC0006]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0006-slots-unification.md |
| 211 | +[RFC0007]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0007-functional-async-api-change.md |
| 212 | +[RFC0011]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0011-v-model-api-change.md |
| 213 | +[RFC0013]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0013-composition-api.md |
| 214 | +[RFC0014]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0014-drop-keycode-support.md |
| 215 | +[RFC0015]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0015-remove-filters.md |
| 216 | +[RFC0016]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0016-remove-inline-templates.md |
| 217 | +[RFC0017]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0017-transition-as-root.md |
| 218 | +[RFC0019]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0019-remove-data-object-declaration.md |
| 219 | +[RFC0020]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0020-events-api-change.md |
| 220 | +[RFC0027]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0027-custom-elements-interop.md |
| 221 | +[RFC0030]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0030-emits-option.md |
| 222 | +[RFC0031]: https://github.com/vuejs/rfcs/blob/master/active-rfcs/0031-attr-fallthrough.md |
0 commit comments