问题描述
我一直在尝试使用google搜索的所有结果作为可能的解决方案,但到目前为止没有任何运气。
每当我在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,depth> : {
| ^
4112 | [K in keyof O]: K extends Path[Pos<I>] ? MergeList<O[K],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
}
}
],};
node_modules/
public/
bin/
build/
vue.config.js
module.exports = {
transpileDependencies: [
'vuetify',pwa: {
workBoxOptions: {
skipwaiting: true,};
感谢您抽出宝贵时间来帮助您
解决方法
我认为.eslintignore
应该是:
node_modules
public
bin
build
,
在 ignorePatterns
中使用 .eslintrc.js
:
module.exports = {
// ...
ignorePatterns: ["**/node_modules/**"] // THIS WORKS!
};