-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Breaking: support new syntax in Vue.js 2.6 #807
Conversation
For example, if you do the following test with {
code: '<template><div :[[attr]]="a" /></template>',
options: ['always']
} But reports is incorrect as spaces are not allowed in dynamic arguments. Although this vue template is a useless, it seems to be valid as a template. https://template-explorer.vuejs.org/#%3Cdiv%20%3A%5B%5Battr%5D%5D%3D%22a%22%20%2F%3E I'd like to change the vue-eslint-parser/6.0.0...vue-eslint-parser/6.0.0-wrap-core What do you think? |
Yeah, you are right. We must disable spacing rules in dynamic arguments. That Would you push it into this branch? |
@mysticatea Thank you for your comment. I will change other wrapper rules later. |
- vue/block-spacing - vue/brace-style - vue/key-spacing - vue/object-curly-spacing - vue/space-infix-ops - vue/space-unary-ops Add testcases - vue/array-bracket-spacing - vue/comma-dangle - vue/no-restricted-syntax
I changed other wrapper rules as well. |
Awesome, thank you! |
- handle dynamic argument names - handle v-slot directive
- support dynamic arguments
- supports autofix to make .prop shortohand to long-form.
OK, I think done. Please review, @michalsnik, @ota-meshi, @armano2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'm sorry, please wait a bit. I found that I have overlooked about tests for references in dynamic arguments. (E.g. |
- update vue-eslint-parser to fix a bug about references.
I believe done this time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm considering if we should mark this PR as a breaking change. This PR will not break CI for people which use our presets such as |
v-html usages is replaced by a safer by default alternative. The goals are multiple: * make it easier to do the right thing for the developers: besides telling Vue to use the plugin at the instantiation of the app, the new directive can be used directly. There is no need of defining a new computed properties to sanize the value which means less boilerplate code. * reduce the number of points to inspect: only the directive/plugin code (and potentially a custom config at the init of the Vue app) instead of all the usages of v-html and the computed props associated with them. Note this does not means v-dompurify-html should be used everywhere, the usages should be limited where there is a real need for it and no alternative (same as v-html). No functionnal change is expected. vue-eslint-parser has been rollbacked to version 5.x. The 6.x version is not yet compatible with eslint-plugin-vue [0] causing false positives. It seems that major versions of vue-eslint-parser and eslint-plugin-vue must be kept in sync. [0] vuejs/eslint-plugin-vue#807 Change-Id: Ibd599706cf3f6b19076841b4d7f330cab11e2e33
This PR updates
vue-eslint-parser
to 6.0.0, contains Vue.js 2.6 support.This release contains drastic change about
VDirectiveKey
node to support dynamic argument syntax. Please see the release note.This PR contains:
vue-eslint-parser@^6.0.0
.