我想使用 Jasmine,并且正在学习 Jasmine 教程,但他们在文档中没有提到如何修复错误“规则'@typescript-eslint/no-unused-expressions 的定义” ' 未找到。eslint(@typescript-eslint/no-unused-expressions)"
错误发生在文件enzyme.ts中:
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import jasmineEnzyme from "jasmine-enzyme";
configure({ adapter: new Adapter() });
// tslint:disable-next-line: only-arrow-functions
beforeEach(function() {
jasmineEnzyme();
});
这是 Jasmine 教程的链接:
最佳答案
typescript-eslint 规则 does exist per the docs 。这里有几种可能性:
- 您的项目未正确包含 typescript-eslint 规则,根据 https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md
- 您使用的是非常旧的 typescript-eslint 版本(2019 年 11 月的规则为 added)
关于reactjs - 找不到@typescript-eslint/no-unused-expressions',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59372937/