Whether it is a multi-person collaboration or a personal project, code standards are very important. Doing so can not only avoid basic syntax errors to a great extent, ESLint is a grammar rule and code style checking tool that can be used to ensure that grammatically correct and uniformly styled code is written. ESLint plugin installation in HBuilderXHBuilderX includes 4 syntax checking plug-ins: htmlhint, stylelint, eslint-plugin-vue, eslint-js. Click Tools -> Plugin Installation, the interface is as follows: Click Plugin Market to enter the Plugin Market and enter eslint to search. Click eslint, go to the details page, and click Install Plugin. Note: hbulider version must be 2.6.8 or above After installing eslint-vue and eslint-js. Click on the menu settings and check Save automatic repairs Custom eslint-js rulesClick on the above picture "Open file .eslintrc.js for configuration", and open the file code as follows: module.exports = { "plugins": [ "html" ], "parser": "esprima", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", "ecmaFeatures": { "jsx": true }, "allowImportExportEverywhere": false }, "rules": { "camelcase": 2, //Force camel case naming, "indent": [2, 4], // indentation style "id-match": 0, // name detection "init-declarations": 1, // must be assigned an initial value when declaring "no-undef": 1, // can not have undefined variables "no-multi-spaces": "error", // prohibit multiple spaces "semi": [2, "always"] ,// automatic addition of semicolons "quotes": ["error", "single"] // use single quotes } }; Detailed rules reference: eslint common configuration restarts Hbulider and automatically fixes code inconsistencies in JS code each time it is saved. Precautions The above settings for using the Hbulider code automatic repair function are only applicable to Hbulider versions above 2.6.8. The above is the detailed content of the real-time verification and automatic repair settings of HbuliderEslint on the vue front end. For more information about HbuliderEslint real-time verification and automatic repair, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: HTML markup language - form
>>: Detailed analysis of the syntax of Mysql update to modify multiple fields and
All websites, whether official, e-commerce, socia...
1. Unzip mysql-8.0.21-winx64 2. Configure environ...
Why do we need virtual dom? Virtual DOM is design...
This article example shares the specific code of ...
Table of contents 1. Overview 1.1 Definition 1.2 ...
Table of contents Use of Vue mixin Data access in...
Table of contents Boolean Type Number Types Strin...
win10 + Ubuntu 20.04 LTS dual system installation...
Summary: Problem solving records of MYSQL: No mat...
Table of contents 1. MySQL installation 1.2 Creat...
When using jquery-multiselect (a control that tra...
1. Solution 1.1 Describing the interface context-...
Table of contents Purpose Experimental environmen...
Table of contents Linux netstat command 1. Detail...
Table of contents 1. The principle of index push-...