Eslint 正在监视 eslintignore 中的文件
Eslint is watching file that are in eslintignore
我有一个 TypeScript 项目,它是由 Webpack 打包的。现在我想添加一些 Eslint。但是有一个问题 - Eslint 会监视编译后的文件,即使它们位于 .eslintignore
中
.eslintignore:
./app
如您所见,Eslint 试图查看 app 目录,但出现错误,因为我在 tsconfig.json 中排除了该目录
{
"compilerOptions": {
"module": "es2020",
"target": "es6",
"jsx": "react",
"allowJs": true,
"sourceMap": true,
"moduleResolution": "node",
"experimentalDecorators": true
},
"include": ["./**/*"],
"exclude": [
"node_modules/**/*",
"app/**/*"
]
}
Eslint不看node_modules,但他们不在.eslintignore。但它会监视 app 目录,该目录位于 .eslintignore 中。我该如何解决?
编辑:
这是我的代码结构:
根据文档,我们似乎不需要 app
前面的点 .
我认为我们只需要将其保留为 app
:
.eslintignore
:
app
// or blob pattern
app/**/*.js
我有一个 TypeScript 项目,它是由 Webpack 打包的。现在我想添加一些 Eslint。但是有一个问题 - Eslint 会监视编译后的文件,即使它们位于 .eslintignore
中.eslintignore:
./app
如您所见,Eslint 试图查看 app 目录,但出现错误,因为我在 tsconfig.json 中排除了该目录
{
"compilerOptions": {
"module": "es2020",
"target": "es6",
"jsx": "react",
"allowJs": true,
"sourceMap": true,
"moduleResolution": "node",
"experimentalDecorators": true
},
"include": ["./**/*"],
"exclude": [
"node_modules/**/*",
"app/**/*"
]
}
Eslint不看node_modules,但他们不在.eslintignore。但它会监视 app 目录,该目录位于 .eslintignore 中。我该如何解决?
编辑:
这是我的代码结构:
根据文档,我们似乎不需要 app
前面的点 .
我认为我们只需要将其保留为 app
:
.eslintignore
:
app
// or blob pattern
app/**/*.js