我对 typescript 做出了 react 。
我正在尝试向我的项目添加一些 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了解更多背景信息。
关于typescript - react typescript eslint plugin - 文件的扩展名 (.svg) 是非标准的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60145171/