【问题标题】:@typescript-eslint/no-unused-expressions' was not found找不到@typescript-eslint/no-unused-expressions'
【发布时间】:2020-04-09 21:06:27
【问题描述】:

我想使用 Jasmine,我正在学习 Jasmine 的教程,但是他们在文档中没有提到如何修复错误“规则的定义 '@typescript-eslint/no-unused-expressions ' 没有找到.eslint(@typescript-eslint/no-unused-expressions)"

错误发生在文件酵素.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 教程的链接:

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

【问题讨论】:

  • 很确定这不是与 jasmine 相关的问题,而是与 eslint 相关的问题。您的项目中有 .eslintrc.js 文件吗?这个文件的内容是什么?
  • 是的,我已经用 tslint 替换了 eslint

标签: reactjs typescript jasmine eslint tslint


【解决方案1】:

那个 typescript-eslint 规则does exist per the docs。这里有几种可能性:

【讨论】:

    猜你喜欢
    • 2019-03-28
    • 2021-06-17
    • 2020-01-25
    • 2021-02-22
    • 2020-05-25
    • 2019-12-22
    • 1970-01-01
    相关资源
    最近更新 更多