-
-
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
Self closing elements break v-if rules #29
Comments
Vue's template parser actually allows self closing components (when using string templates directly). Is there anyway to relax these rules? |
I got it. |
There's no transform, but in https://github.com/vuejs/vue/blob/dev/src/compiler/parser/html-parser.js we just treat self closing tags as if they have a closing tag. |
Thank you. Hmm. |
@mysticatea have you thought of building the new parser on top of Vue's parser? I can expose the parse method in |
@mysticatea I would like to integrate eslint-vue into https://github.com/octref/vetur, a editor tool for Vue. If we can base eslint-vue and vetur on the same template parser, one additional parsing can be saved in editor! Also, fewer parsing incompatibility will be present. @yyx990803 Currently Let's see how can we improve. |
@yyx990803 It would be best if we use the same parser between Vue.js and @HerringtonDarkholme The parser that |
@mysticatea oh yeah that's right... In that case, is it possible to build the separate parser on top of Vue's own parser, enhancing it with Node location information? If that's possible, we can even use it to produce source maps for compiled render functions. |
^ I can think of two ways of doing this:
|
Was about to suggest just that! 😄 |
Though it may be related to these, we might as well try to design plugin architecture of |
- When the user clicks on a "View Guide" button in the Search Page, the app switches to the Guide Page and displays the contents of the guide. - When the user clicks on the "Close Guide" button in the Guide Page, the app switches back to the Search Page. Note: I must explicitly close component tags (<page-guide></page-guide>) because using self-closing tags (<page-guide />) breaks v-if logic. For more information on this issue, see: - https://vuejs.org/v2/style-guide/#Self-closing-components-strongly-recommended - vuejs/eslint-plugin-vue#29
…npm_and_yarn/javascript-package/eslint-plugin-jest-26.1.4 Bump eslint-plugin-jest from 26.1.1 to 26.1.4 in /javascript-package
Self-closing elements break the following rules:
Expected
This should not be reported:
Happening
This works:
This doesn't:
Here are the report messages:
The text was updated successfully, but these errors were encountered: