Extension shouldn't attempt to fold :class properties in Vue files
See original GitHub issueWith the following code:
The extension attempts to fold the :classes
, resulting in a broken code indentation:
This can currently be fixed by changing the setting inlineFold.regex
to:
(class|className)=[`'{"]([^`'"{}]+)[`'"}]
(added a {
in the middle part)
Maybe a better solution could be something like this:
(class|className)=([`'"{])([^]+?)\2
but you will probably need to update the capture groups indexes in the code
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Typescript and Vue in general · Issue #478 · vuejs/vue - GitHub
The VueTS solution was to have a class extend Vue and define properties as class members thus the instance API is in sync...
Read more >vue.js - How disable eslint warning for a specific line in a ...
I would like to dismiss this error on my vue file. I am trying to add this processor line
Read more >Style Guide - Vue.js
Style Guide. This is the official style guide for Vue-specific code. If you use Vue in a project, it's a great reference to...
Read more >How to Structure a Large Scale Vue.js Application
What is the best way to structure a Vue.js application so that it scales and remains maintainable and extendable the more it grows?...
Read more >How to Build a Chrome Extension with Vue - SitePoint
James Hibbard shows how to build a simple Chrome extension, which alters the behavior of the new tab page, using the Vue.js framework....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@wc-davide Yeah react and jsx brought lots of troubles with the template literal. Your colleagues suggested an interesting method 🧐. I will have a look into that. Since you use normal values in the class and far from using jsx. I think you can simply remove the jsx containers
{}
and use a whitespace. 👍UPDATE: I’ve tested your colleague method https://regex101.com/r/XXrZHt/1 I’ve completely forgot that we tried that with no success, as you can see in the last line it will stop at the first occurrence of
}
, because it is not greedy, we also tried to make it greedy, but it consumed any following attribute as well. That’s why i’m writing a simple non-regex method only for Jsx. I have always wondered why most of compilers has an extra plugin for Jsx alone, but I fully understand it now 😵💫I’m glad you sorted it out 😃 Maybe in upcoming update I will make the default regex with pre whitespace 👍🏻
Feel free to reopen if you have a suggestion.