未找到@typescript-eslint/no-un-un-used-expressions'



我想使用 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();
});

这是茉莉花教程的链接:

https://jasmine.github.io/tutorials/react_with_npm

根据文档,打字稿-eslint 规则确实存在。这里有几种可能性:

  • 您的项目未正确包含打字稿 eslint 规则,每个 https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md
  • 您使用的是非常旧版本的打字稿-eslint(该规则于 2019 年 11 月添加(

相关内容

最新更新