【发布时间】:2021-08-07 17:54:12
【问题描述】:
所以我的文件中有这个导入
import { catchError, finalize } from 'rxjs/operators';
当我运行 eslint 时出现此错误:
error 'rxjs/operators' should be listed in the project's dependencies. Run 'npm i -S rxjs/operators' to add it import/no-extraneous-dependencies
我在 package.json 依赖项列表中有 rxjs,但似乎 eslint 认为 'rxjs/operators' 是另一个包。
在我的 eslintrc 文件中,我有这个规则:
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["**/*.test.ts", "**/*.test.tsx"]
}
],
【问题讨论】:
标签: typescript eslint package.json