简体   繁体   中英

What is “.eslintrc.js” in React Native?

I am using React Native version 0.61.4 where the .eslintrc.js file caught my eye.

What is .eslintrc.js and what is its use in the React Native?

The file.eslintrc.js is a configuration file for a tool named 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. In many ways, it is similar to JSLint and JSHint with a few exceptions:

  • ESLint uses Espree for JavaScript parsing.
  • ESLint uses an AST to evaluate patterns in code.
  • ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.

Source: https://eslint.org/docs/user-guide/getting-started

It is ESlint configuration file.

ESLint statically analyzes your code to quickly find problems. ... Many problems ESLint finds can be automatically fixed. 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

It is not related to react-native , but to eslint . Which is probably the most popular js linter.

In a nut shell it is a configuration file for eslint .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM