簡體   English   中英

react typescript eslint plugin - 文件的擴展名 (.svg) 是非標准的

[英]react typescript eslint plugin - The extension for the file (.svg) is non-standard

我對打字稿做出了反應。

我正在嘗試向我的項目添加一些 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

使用eslint src --ext .ts,.tsx為我修復了它。

有關更多背景信息,請參閱https://stackoverflow.com/a/43742235/691083

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM