Closed
Description
Tell us about your environment
- ESLint Version: v4.19.1
- eslint-plugin-vue Version: 4.4.0
- Node Version: 9.11.1
Please show your full configuration:
{
"extends": [
"../.eslintrc",
"plugin:vue/base",
"plugin:vue/essential",
"plugin:vue/strongly-recommended",
"plugin:vue/recommended"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "typescript-eslint-parser"
},
"plugins": [
"import",
"typescript"
],
"settings": {
"import/resolver": {
"webpack": {
"config": "./webpack.dev.js"
}
}
},
"rules": {
"no-undef": "off",
"import/extensions": ["error", "always", {
"js": "never",
"ts": "never"
}],
"vue/html-closing-bracket-newline": ["error", {
"singleline": "never",
"multiline": "always"
}],
"vue/html-closing-bracket-spacing": ["error", {
"startTag": "never",
"endTag": "never",
"selfClosingTag": "always"
}],
"vue/html-self-closing": ["error", {
"html": {
"normal": "never"
}
}],
"vue/prop-name-casing": ["error", "camelCase"],
"vue/script-indent": ["error", 2]
}
}
What did you do? Please include the actual source code causing the issue.
export default Vue.extend({
methods: {
getStarClassNamePostfix(index: number) {
let starClassNamePostfix: string = '';
switch (index) {
case 0:
starClassNamePostfix = '-lighter';
break;
case 1:
starClassNamePostfix = '-light';
break;
case 2:
starClassNamePostfix = '';
break;
case 3:
starClassNamePostfix = 'dark';
break;
case 4:
starClassNamePostfix = 'darker';
break;
default:
starClassNamePostfix = '';
}
return starClassNamePostfix;
},
},
});
When using switch
case in methods with configured vue/script-indent
param, eslint-plugin-vue falsely reports wrong indentation inside it as seen here:
However, when changing indentation to that considered proper one by vue/script-indent
(which is actually wrong), 'native' indent
ESLint rule comes in: