简体   繁体   English

React Native 中的“.eslintrc.js”是什么?

[英]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

It is not related to react-native , but to eslint .它与react-native ,而是与eslint相关。 Which is probably the most popular js linter.这可能是最流行的 js linter。

In a nut shell it is a configuration file for eslint .在螺母 shell 中,它是eslint的配置文件。

暂无
暂无

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

相关问题 .eslintrc.js键,带“-”(破折号) - .eslintrc.js keys with “-” (dash) 如何使用 allow: 带有 eslintrc.js 的选项 - How to use allow: options with eslintrc.js env.es6=true 和 parserOptions.ecmaVersion=6 at.eslintrc.js 有什么区别? - What the difference between env.es6=true and parserOptions.ecmaVersion=6 at .eslintrc.js? 如何获取.eslintrc.js忽略所有无js文件 - How to get .eslintrc.js ignore all none js files 必须使用import加载ES Module.eslintrc.js - Must use import to load ES Module .eslintrc.js 在 .eslintrc.js 文件中使用导出默认值而不是 module.exports - Use export default in .eslintrc.js file instead of module.exports 错误:.eslintrc.js 中的 ESLint 配置无效:-意外的顶级属性“文件” - Error: ESLint configuration in .eslintrc.js is invalid: - Unexpected top-level property "files" npm init nuxt-app 结果出现问题“无法加载在‘.eslintrc.js » @nuxtjs/eslint-config’中声明的插件‘unicorn’” - npm init nuxt-app results a problem "Failed to load plugin 'unicorn' declared in '.eslintrc.js » @nuxtjs/eslint-config'" ESLint 8.31.0“错误:无法加载在‘.eslintrc.js » eslint-config-standard’中声明的插件‘import’:找不到模块‘array.prototype.flatmap’” - ESLint 8.31.0 "Error: Failed to load plugin 'import' declared in '.eslintrc.js » eslint-config-standard': Cannot find module 'array.prototype.flatmap" 什么相当于React JS的React Native {flex:1}? - What's the equivalent of React Native { flex: 1 } for React JS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM