{
"name": "kk",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.32.2",
"register-service-worker": "^1.7.2",
"vue": "^3.3.4",
"vue-router": "^4.2.5",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.22.20",
"@babel/eslint-parser": "^7.22.15",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-pwa": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^12.0.0",
"eslint": "^8.49.0",
"eslint-config-alloy": "^5.1.2",
"eslint-plugin-vue": "^9.17.0",
"less": "^4.2.0",
"less-loader": "^8.1.1",
"typescript": "~5.2.2",
"vue-eslint-parser": "^9.3.1"
}
}
eslintrc
module.exports = {
extends: ['alloy', 'alloy/vue', 'alloy/typescript'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
js: '@babel/eslint-parser',
jsx: '@babel/eslint-parser',
ts: '@typescript-eslint/parser',
tsx: '@typescript-eslint/parser'
// Leave the template parser unspecified, so that it could be determined by `<script lang="...">`
}
},
env: {
// Your environments (which contains several predefined global variables)
//
// browser: true,
// node: true,
// mocha: true,
// jest: true,
// jquery: true
},
globals: {
// Your global variables (setting to false means it's not allowed to be reassigned)
//
// myGlobal: false
},
rules: {
// Customize your rules
//
// Please keep this rule off because it requiresTypeChecking
// https://github.com/vuejs/vue-eslint-parser/issues/104
// https://github.com/typescript-eslint/typescript-eslint/pull/5318
'@typescript-eslint/prefer-optional-chain': 'off'
}
}
报错信息
ERROR in [eslint] Error while loading rule '@typescript-eslint/consistent-type-assertions': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
在网上查了一下,都是说在eslintrc的parserOptions下新建个project键,然后写上tsconfig.json的位置,但是配置后并没有生效。有哪位大佬知晓什么情况吗?
https://cli.im/text