[英]What is “.eslintrc.js” in React Native?
I am using React Native version 0.61.4 where the .eslintrc.js
file caught my eye.我正在使用 React Native 版本 0.61.4,其中
.eslintrc.js
文件引起了我的注意。
What is .eslintrc.js
and what is its use in the React Native?什么是
.eslintrc.js
以及它在 React Native 中的用途是什么?
The file.eslintrc.js is a configuration file for a tool named ESLINT. file.eslintrc.js 是一个名为 ESLINT 的工具的配置文件。
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.
ESLint 是一种用于识别和报告在 ECMAScript/JavaScript 代码中发现的模式的工具,其目标是使代码更加一致并避免错误。 In many ways, it is similar to JSLint and JSHint with a few exceptions:
在许多方面,它类似于 JSLint 和 JSHint,但有一些例外:
- ESLint uses Espree for JavaScript parsing.
ESLint 使用 Espree 进行 JavaScript 解析。
- ESLint uses an AST to evaluate patterns in code.
ESLint 使用 AST 来评估代码中的模式。
- ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
ESLint 是完全可插拔的,每一条规则都是一个插件,你可以在运行时添加更多。
Source: https://eslint.org/docs/user-guide/getting-started资料来源: https://eslint.org/docs/user-guide/getting-started
It is ESlint configuration file.它是 ESlint 配置文件。
ESLint statically analyzes your code to quickly find problems.
ESLint 静态分析您的代码以快速发现问题。 ... Many problems ESLint finds can be automatically fixed.
... ESLint 发现的许多问题都可以自动修复。 Fixes are syntax-aware so you won't experience errors introduced by traditional find-and-replace algorithms.
修复是语法感知的,因此您不会遇到传统查找和替换算法引入的错误。
More information about ESlint and configuration you can find here https://eslint.org/docs/user-guide/configuring有关 ESlint 和配置的更多信息,您可以在此处找到https://eslint.org/docs/user-guide/configuring
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.