我已经尝试了谷歌搜索上的所有结果,作为一种可能的解决方案,但到目前为止没有任何运气。
每当我在我的vue项目(使用vue cli创建)上运行npm run vue-cli-service serve --port 1024时,我收到来自node_modules的错误
4111:10 Type alias 'MergeList' circularly references itself.
4109 | @hidden
4110 | */
> 4111 | type MergeList<O, Path extends List<Key>, O1 extends object, depth extends Depth, I extends Iteration = IterationOf<'0'>> = O extends object ? O extends (infer A)[] ? MergeList<A, Path, O1, depth, I>[] : Pos<I> extends Length<Path> ? OMerge<O, O1, depth> : {
| ^
4112 | [K in keyof O]: K extends Path[Pos<I>] ? MergeList<O[K], Path, O1, depth, Next<I>> : O[K];
4113 | } & {} : O;
4114 | /**所有的错误看起来都来自一个文件夹:ts-toolbelt。最终结果可以在这里看到:pastebin
这是我的.eslintrc
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
'@vue/typescript',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
'import/no-cycle': 'off',
},
parserOptions: {
parser: '@typescript-eslint/parser',
exclude: [
"node_modules"
]
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
jest: true
}
}
],
};.eslintignore
node_modules/
public/
bin/
build/vue.config.js
module.exports = {
transpileDependencies: [
'vuetify',
],
pwa: {
workboxOptions: {
skipWaiting: true,
},
},
};感谢任何人抽出时间来帮助我们
发布于 2021-07-21 07:07:42
在.eslintrc.js中使用ignorePatterns
module.exports = {
// ...
ignorePatterns: ["**/node_modules/**"] // THIS WORKS!
};发布于 2020-09-11 18:52:08
我认为.eslintignore应该是:
node_modules
public
bin
buildhttps://stackoverflow.com/questions/63813690
复制相似问题