简体   繁体   English

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

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

I have react with typescript.我对打字稿做出了反应。

I am trying to add some eslint to my project and I got this error during yarn lint我正在尝试向我的项目添加一些 eslint,但在 yarn lint 期间出现此错误

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

I also get some error on css我也在 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

the same for .css .css 也一样

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

Using eslint src --ext .ts,.tsx fixed it for me.使用eslint src --ext .ts,.tsx为我修复了它。

See https://stackoverflow.com/a/43742235/691083 for more background information.有关更多背景信息,请参阅https://stackoverflow.com/a/43742235/691083

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 非标准TypeScript接口/类字段 - non-standard TypeScript interface/class fields ESLint:防止被 lint 非标准文件扩展名 - ESLint: prevent from being linted non-standard files extensions Svelte 中非标准窗口事件的 TypeScript 类型 - TypeScript typing of non-standard window event in Svelte 使用 ESlint 在 TypeScript 项目中使用 SVG 的正确方法 - Correct way of working with SVG in a TypeScript React project with ESlint 在打字稿中启用react-hooks eslint插件。 tslint中没有插件 - enabling the react-hooks eslint plugin in typescript. no plugins in tslint Typescript eslint - 缺少文件扩展名“ts”导入/扩展 - Typescript eslint - Missing file extension "ts" import/extensions ESLint 找不到插件“eslint-plugin-@typescript-eslint” - ESLint couldn't find the plugin "eslint-plugin-@typescript-eslint" eslint - 无法加载插件“@typescript-eslint” - eslint - Failed to load plugin '@typescript-eslint' 使用带有 typegraphql 的非标准类型 (BigNumber) - Using a non-standard type (BigNumber) with typegraphql 为什么允许使用 kebab-case 非标准属性,而不允许使用其他属性? 以及如何在 TypeScript 中定义这样的类型? - Why kebab-case non-standard attributes are allowed while others aren't? And how to define types like this in TypeScript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM