问题描述
我的存储库,门户网站和商店中有多个项目。我都想使用打字稿,因此我有以下项目结构:
如您所见,tsconfig.json
和.eslint.js
在门户和商店项目之外。在我的tsconfig文件中,出现此错误:
Cannot find deFinition file for 'webpack-env'
然后,如果我尝试运行npm run serve
,则会出现此错误:
Failed to load plugin 'vue' declared in '..\.eslintrc.js': Cannot find module 'eslint-plugin-vue'
tsconfig.json
:
{
"compilerOptions": {
"target": "ES2020","module": "ESNext","strict": true,"jsx": "preserve","importHelpers": true,"moduleResolution": "node","experimentalDecorators": true,"allowJs": true,"esModuleInterop": true,"allowSyntheticDefaultImports": true,"sourceMap": true,"baseUrl": "portal","types": [
"webpack-env"
],"paths": {
"@/*": [
"src/*"
]
},"lib": [
"esnext","dom","dom.iterable","scripthost"
]
},"include": [
"portal/src/**/*.ts","portal/src/**/*.tsx","portal/src/**/*.vue"
],"exclude": [
"node_modules"
]
}
.eslintrc.js
:
module.exports = {
root: true,env: {
node: true,},extends: [
'plugin:vue/essential','@vue/airbnb','@vue/typescript/recommended','plugin:import/errors','plugin:import/warnings','plugin:import/typescript',],rules: {
'prefer-destructuring': ['error',{ object: false,array: false }],'no-debugger': 'off','max-len': 'off','@typescript-eslint/no-non-null-assertion': 'off','arrow-parens': 'off','max-classes-per-file': 'off','@typescript-eslint/interface-name-prefix': 'off','@typescript-eslint/explicit-module-boundary-types': 'off',parserOptions: {
parser: '@typescript-eslint/parser',
};
我在这里做事吗?我在网上搜索了无数次,找不到解决方案,甚至找不到一个人正在实现我想要达到的目标的例子
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)