【问题标题】:react typescript eslint plugin - The extension for the file (.svg) is non-standardreact typescript eslint plugin - 文件(.svg)的扩展名是非标准的
【发布时间】:2020-02-10 06:33:51
【问题描述】:

我已经对打字稿做出反应。

我正在尝试将一些 eslint 添加到我的项目中,但在 yarn lint 期间出现此错误

(eslint src/** --ext .ts,.tsx")

我在 css 上也遇到了一些错误

  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/logo.svg.
The extension for the file (.svg) is non-standard. You should add "parserOptions.extraFileExtensions" to your config

.css 也是如此

我的 eslint 基于这篇文章 https://gist.github.com/1natsu172/a65a4b45faed2bd3fa74b24163e4256e

【问题讨论】:

    标签: typescript eslint


    【解决方案1】:

    使用eslint src --ext .ts,.tsx 为我修复了它。

    有关更多背景信息,请参阅https://stackoverflow.com/a/43742235/691083。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-03
      • 2021-03-24
      • 2018-04-16
      • 2012-05-20
      • 2018-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多