我无法让template
linter 对我的 .vue 文件的一部分进行 lint。您对我需要更改配置有什么意见吗?
总的来说,我希望 linter 调整如下:
<template>
<v-container>
<h1>Home</h1>
</v-container>
</template>
对此:
<template>
<v-container>
<h1>Home</h1>
</v-container>
</template>
这是我的配置:
// .eslintrc
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
和依赖项:
// package.json
{
"name": "mobile.zmittag",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
"postinstall": "npm run build",
"start": "node server.js",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"auth0-js": "^9.10.1",
"axios": "^0.18.0",
"connect-history-api-fallback": "^1.6.0",
"core-js": "^2.6.5",
"express": "^4.16.4",
"register-service-worker": "^1.6.2",
"serve-static": "^1.13.2",
"vue": "^2.6.6",
"vue-i18n": "^8.0.0",
"vue-router": "^3.0.1",
"vuetify": "^1.5.5",
"vuex": "^3.0.1"
},
"devDependencies": {
"@kazupon/vue-i18n-loader": "^0.3.0",
"@vue/cli-plugin-babel": "^3.5.0",
"@vue/cli-plugin-eslint": "^3.5.1",
"@vue/cli-plugin-pwa": "^3.5.0",
"@vue/cli-plugin-unit-jest": "^3.5.0",
"@vue/cli-service": "^3.5.0",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"fibers": "^3.1.1",
"sass": "^1.17.2",
"sass-loader": "^7.1.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-i18n": "^0.6.0",
"vue-cli-plugin-vuetify": "^0.5.0",
"vue-template-compiler": "^2.5.21",
"vuetify-loader": "^1.0.5"
}
}