我有一个.Net Core Web Application
,我vue
在客户端使用。我已经.eslintrtc
用所需的规则配置了文件,但编辑器似乎忽略了.vue
文件。请看下面我的配置
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
eqeqeq: 'off', // off
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-extend-native': [2, { exceptions: ['Object', 'Array', 'String', 'Number', 'Date'] }],
indent: ['error', 4, { SwitchCase: 1 }],
'vue/script-indent': ['error', 4, {
baseIndent: 1,
switchCase: 1,
ignores: []
}],
semi: ['error', 'always'],
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'prefer-const': 0,
'no-case-declarations': 0,
'no-empty-pattern': 0,
'no-mixed-operators': 0
},
parserOptions: {
parser: 'babel-eslint'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)'
],
env: {
mocha: true
}
},
{
files: ['*.vue'],
rules: {
indent: 'off'
}
}
]
};
下面列出了 package.json 开发依赖项
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.5.7",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.0.3",
"eslint": "^5.16.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.0.0",
"sass": "^1.18.0",
"sass-loader": "^10.0.3",
"vue-template-compiler": "^2.6.12"
}
如何配置Visual Studio 2019
为自动 linting.vue
文件?我提到在Visual studio Code
工作中(但我需要工作Visual Studio 2019
)