Open
Description
As it seems to be almost impossible to change this afterwards eslint/eslint#7456 (comment) it would be great to be able to create files with more identation, for those that want it
As it seems to be almost impossible to change this afterwards eslint/eslint#7456 (comment) it would be great to be able to create files with more identation, for those that want it
Activity
vue-bot commentedon Oct 8, 2018
Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!
LinusBorg commentedon Oct 8, 2018
You're linking to a comment from 2 years ago, commenting on usage of an eslint-plugin that we don't use.
Judging from the comment your linked to, your problem seems with indentation in templates?
eslint-plugin-vue
has rules for this that should be--fix
-able:https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-indent.md
https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/script-indent.md
simonh1000 commentedon Oct 8, 2018
thanks - and apologies for the poor original issue. Yesterday was my first day with Vue and I spent the whole time to trying to get 4 spaces. Lots of people offered ideas on discord, but nothing worked.
Based on your suggestion, I added this to package.json
Then is eslintrc I have
then when I run
but the problem is that no files ever get changed.
That was why I asked for an option to do it automatically.
LinusBorg commentedon Oct 8, 2018
That might make it clearer.
Now if you follow the rules and actually provide a run able reproduction I can reopen the issue.
For example, it would have been 'em sly helpful to know that you chose typescript for your project.
What we can do is try and find a way to make
--fix
work for your scenario - because we don't have any other tool to dynamically change indentation, so providing an "option" won't solve your problem.simonh1000 commentedon Oct 8, 2018
The repro is
npx eslint --fix *.js
, ornpx eslint --fix src/*.ts
Expect: files matching the target to be changed on disk
Result:
Nothing changed on disk
MacOS 10.14, Node v10.10.0
simonh1000 commentedon Oct 9, 2018
As discussed on discord - here are the files resulting from
vue create
(basically typescript plus some options)only file changed is eslintrc
i've replaced README with some of the commands I've tried
I think we've already established that tslint cannot help (but see also https://stackoverflow.com/questions/52707751/vue-cli-with-4-space-identation)
Archive.zip
mrodal commentedon Oct 9, 2018
I literally did just this:
And I got the files fixed to 4 spaces
simonh1000 commentedon Oct 10, 2018
Aha. I tried again and compared your changes to what the cli provides, and the key points are
"vue/script-indent": ['error', 4, { 'baseIndent': 1 }]
and"eslint:recommended",
instead of'@vue/standard',
It is the second change that enables npm run lint to run AND fix things. Hope that helps
9 remaining items