ESLint: Mixed spaces and tabs
Hey there,
I'm trying to write a VueJS App.
Inside the .vue files and there only in the script sections when trying to write an if statement or a method for example it sometimes randomly switches from tab indent to space indent.
The error, mentioned in the title of this post is shown and the whole App wont run until this is resolved.
Worse even:
Deleting the "space-tab" an trying again with a "real tab" won't do.
Often times even deleting and hand writing the whole method again won't even resolve it, it enforces a space indent. No matter how I try to make it a tab or try deleting the spaces
The next "random number" of methods that I'll be coding will have normal tab indent and if I'm super lucky I can then resolve the issue after having written another couple lines of code.
Super weird and random behaviour.
Last week, I tried a little reactJS and had no issues there so it seems to be a thing with vue or a problem that at least the linter only sees in vue.
Hope you guys got an I idea. I'm relatively new to webstorm, coming from an simpler Editor and really have no idea how to resolve this
Thanks alot
Please sign in to leave a comment.
make sure to enable Use Tab character in both HTML and JavaScript code style settings (Settings | Editor | Code Style | HTML | Tabs and Indents, Settings | Editor | Code Style | JavaScript | Tabs and Indents) - does it help?
I'd also suggest disabling editorconfig support in Settings | Editor | Code Style by unchecking Enable Editorconfig support checkbox to make sure that IDE code style settings are not overridden by editorconfig
I guess it was that easy.
Even after multiple checks I obviously didn't see that Use Tab Character was unchecked for JS, the second thing I unchecked aswell. It was probably that which sometimes did override and sometimes not, hence why at times JS was space indented and sometimes with tab.
Thanks alot Elena!