Reactjs 关于“create react app--template typescript”如何与typescript eslint连接的困惑

Reactjs 关于“create react app--template typescript”如何与typescript eslint连接的困惑,reactjs,typescript,eslint,typescript-eslint,Reactjs,Typescript,Eslint,Typescript Eslint,我使用npx create react app my app--template typescript创建了一个react项目。我发现默认情况下,typescript eslint已经启用了。 我检查了package.json中的eslint配置 "eslintConfig": { "extends": "react-app" }, 我认为要启用typescript eslint,您需要“扩展”:[“插件:@typesc

我使用
npx create react app my app--template typescript
创建了一个react项目。我发现默认情况下,
typescript eslint
已经启用了。

我检查了
package.json中的eslint配置

"eslintConfig": {
    "extends": "react-app"
  },

我认为要启用
typescript eslint
,您需要
“扩展”:[“插件:@typescript eslint/推荐”
在您的
包.json
.eslintrc
中。但在这种情况下,我在代码库中找不到其中任何一个。我想知道eslint for typescript是如何启用的?

CRA旨在成为设置react应用程序的一站式商店。这包括构建配置、文件夹结构以及开发应用程序所需的一切使用最佳实践对应用程序作出反应

虽然没有在任何地方明确列出,但CRA使用
eslint-config-react-app
config提供了预配置的linting体验

在主页上,他们提到:

(强调矿山)

在IDE体验之类的地方也提到了这一点,但以一种“你应该已经知道这是一件事”的方式:


对于typescript项目,CRA config ofc包括
@typescript eslint
项目中的工具,因为它是linting typescript代码的标准

如果不使用这个项目,他们在尝试lint typescript代码库时会遇到很多问题(最大的问题是它根本不起作用)


上面的文档包含有关如何进一步配置linting体验的信息(如果需要)。

您是否查看了react应用程序ESLint插件?它引用了其他插件:@jornsharpe是的,我查看了它,但没有发现它引用了typescript ESLint插件……您看得有多辛苦?