The upper part is the English version, and the lower part is the Chinese version, with the same content. If there are any wrong, or you have anything hard to understand, especially in the English version(it is modifications based on Google Translate), pls feel free to let me know.many thx.
Overview
Use ESLint + Prettier to make the project code uniform format
ESLint: Select ESLint when Taro initializes the project, then related packages will be installed automatically
Prettier: Need to install manually "esint-config-prettier": "^6.15.0""esint-plugin-prettier": "^3.4.0""prettier": "^2.3.2"
Then run yarn lint-fix on the console. That is to repair the overall project format.
4. VsCode configuration
VsCode v1.5.7
Goal: To prompt errors for VsCode and automatically format when saving.
4.1 Install ESLint plugin
4.2 Configure automatic saving in VsCode
4.2.1 Project Configuration
Only effective for the current project, other projects will not affect
Create a .vscode folder in the project root directory and create a settings.json file
Refer to VsCode Configuration Document
This configuration is effective for all projects, only need to choose one of project configuration and global configuration
Open the menu bar Code-Preferences-Settings
The upper part is the English version, and the lower part is the Chinese version, with the same content. If there are any wrong, or you have anything hard to understand, especially in the English version(it is modifications based on Google Translate), pls feel free to let me know.many thx.
Overview
"@tarojs/taro": "3.0.27 ``"react": "^16.10.0"
1. Install ESLint related npm packages
2. Establish configuration files
2.1 .eslintignore
2.2 .eslintrc.js
2.3 .prettierrc
3. Overall project formatting
4. VsCode configuration
VsCode v1.5.7
4.1 Install ESLint plugin
4.2 Configure automatic saving in VsCode
4.2.1 Project Configuration
4.2.2 Global Configuration
4.2.2 Configure automatic saving
The following is the Chinese version, the same content as above
Overview
"@tarojs/taro": "3.0.27
"react": "^16.10.0"
1. 安装ESLint 相关npm包
2. 建立配置文档
2.1 .eslintignore
2.2 .eslintrc.js
2.3 .prettierrc
3. 项目整体格式化
4. VsCode 配置
VsCode v1.5.7
4.1 安装ESLint插件
4.2 在VsCode 配置自动保存
4.2.1 项目配置
4.2.2 全局配置
4.2.2 配置自动保存