WebStorm codestyle does not understand all eslint rules

I am using WebStorm 2019.3, and working on a Vue.js project.

My eslint rules are pretty much the standard ones, one of which is

"vue/script-indent": [{ "baseIndent": 0 }]

This means that the base indent after the script tag should be zero. The eslint plugin correctly warns me, and highlights code that does not conform, but WebStorm's auto format indents the code directly after the script tag to 2 spaces. I have tried manually importing the eslintrc file, and I cannot get WebStorm to auto format correctly.

Any help would be great.

0
2 comments

only core ES rules are imported from .eslintrc, importing rules from eslint-plugin-vue is not implemented. Please vote for https://youtrack.jetbrains.com/issue/WEB-34649 to be notified on any progress with it.

 Indents in script block, e.g

<script>
console.log('');
</script>

vs

<script>
console.log('');
</script>

can be configured by adding 'script' to the list of tags under Code Style -> HTML -> Other -> Do not indent children of.. See https://youtrack.jetbrains.com/issue/WEB-30382

1
Avatar
Permanently deleted user

Hi Elena,

That worked perfectly. I'll make sure to vote on the issue!

Cheers

0

Please sign in to leave a comment.