[solved] eslint no-tabs errors
-
I use atom and the eslint atom package for other work. I keep an eslintrc.js file in my home directory for all projects.
https://github.com/AtomLinter/linter-eslintI’m just now getting back to messing with quasar and when running quasar dev or lint on the default template I get errors that keep it from building related to spaces vs tabs (I use tabs). As there is a .eslintrc.js file in the project directory the atom package should use it rather then my “global” one but this seems not the case. I also get errors in atom itself from the eslint plugin
Can someone using atom eslinter give some advice how to resolve this.
/mnt/AllData/hacking/eval-repos/645light/src/main.js 16:2 error Unexpected tab character no-tabs 17:2 error Unexpected tab character no-tabs 17:2 error Expected indentation of 2 spaces but found 1 tab indent ... Errors: 6 http://eslint.org/docs/rules/no-tabs 5 http://eslint.org/docs/rules/indent @ multi ./build/hot-reload ./src/main.js
-
I believe you need to either remove the eslintrc.js file from your app (the one Quasar offers) or edit it to fit your rules.
Scott
-
Turns out somehow the no-tabs is being set (how I have not clue, maybe in html plugin??)
If one adds
"no-tabs": 0,
the errors go awayIt’s enough of a “bug” that the maintainers should add this to the template’s .eslintrc.js. That way for those of us liking tabs errors are not thrown but otherwise spaces are accepted by default
@rstoenescuSee this post this stackoverflow post
https://stackoverflow.com/questions/40893518/eslint-unexpected-tab-character-when-indent-rule-set-to-tab -
maybe you should try editorconfig
-
@dgk said in [solved] eslint no-tabs errors:
It’s enough of a “bug” that the maintainers should add this to the template’s .eslintrc.js. That way for those of us liking tabs errors are not thrown but otherwise spaces are accepted by default
@rstoenescuThe linting rules Quasar follows are from StandardJS, with a couple of exceptions.
http://beta.quasar-framework.org/guide/app-linter-configuration.html
https://github.com/standard/standard/blob/master/RULES.mdAs you can see from the rules of StandardJS, spaces should be used for indentation.
It’s not a bug. It’s how it should be (since we are following that linting standard). You’ve found the correct solution though. Just modify the linting config, as you have.
Scott