script-indent make me crazy!!!!!!!
See original GitHub issueTell us about your environment
- ESLint Version:
^4.15.0
- eslint-plugin-vue Version:
^4.0.0
- Node Version:
^8.9.0
- IDE:
webstorm 2017.2.5
Please show your full configuration:
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// // 没找到解决方案, 一格式化webstorm script标签下面就会缩进,一缩进,eslint就报警。
// // 只能从根源把他且了。
// 'indent': ['off'],
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
What did you do? Please include the actual source code causing the issue.
<template>
<div id="app">
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
What did you expect to happen?
<template>
<div id="app">
</div>
</template>
<script>
// attension here. it is about 2 indent before javascript code
export default {
name: 'App'
}
</script>
What actually happened? Please include the actual, raw output from ESLint.
This happend when i command in npm run dev
✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
src\App.vue:10:1
export default {
^
✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4
src\App.vue:11:1
name: 'App'
^
✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
src\App.vue:12:1
}
^
As you can see above. This is not my expect things. Does any config to avoid these happen?
Otherwise, i may closing the indent config.although it is not a good experience.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:34
- Comments:21 (4 by maintainers)
Top Results From Across the Web
vue-cli3 eslint vue/script-indent conflicting with compiler
error: Expected indentation of 32 spaces but found 24 spaces (vue/script-indent). What's causing this weird conflict?
Read more >vue/script-indent
Rule Details #. This rule enforces a consistent indentation style in <script> . The default style is 2 spaces.
Read more >Roblox Script Not Auto Indenting? - Code Review - DevForum
When ever I create a new line when i'm scripting, it doesn't automatically indent and it's driving me crazy and it wastes alot...
Read more >Vue 设置Script 标签首层不缩进 - 简书
script-indent make me crazy !!!!!!! #362 · enforce consistent indentation in <script> (vue/script-indent).
Read more >How To Configure Vue Cli 4 With Eslint + Airbnb Rules + ...
Create a project with Vue CLI 3 Select TypeScript support + ESLint + Airbnb config this will result in the ... eslint plugin...
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 FreeTop 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
Top GitHub Comments
If you are using webstorm, you can
File => Setting => Editor => Code Style => HTML
addDo not indent children of
rule toscript
When working with
*.vue
files, this seems a better option to me: to disable theindent
rule only for Vue files and set a base indent: