Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure and use ESLine

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to configure and use ESLine". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to configure and use ESLine" can help you solve your doubts.

Environment: React,Webpack,Babel

Basic installation

Npm install eslint-save-dev

Npm install eslint-loader-save-dev

Dealing with ES6

Npm install babel-eslint-save-dev

For React

Npm install eslint-plugin-react-save-dev

Configure in webpack

.. module: {rules: [{test: /\. (js | jsx) $/, exclude: / node_modules/,use: ["babel-loader", "eslint-loader"]}}.

Detailed rule configuration

Create a new .eslintrc file under the root of the project (can be generated by eslint-- init)

Ignore detection

The new .eslintignore file in the root directory directly writes the directory to be ignored.

Src/containers/hotSearch/src/entry/src/helper/src/store/

At this point, there is a red wavy line prompt for errors in writing code, such as direct use of variables without definition.

After the project is running, you can view the error report in the console console.

It is recommended that you rerun the project each time you modify the .eslintrc file rules.

After reading this, the article "how to configure and use ESLine" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report