eslint Function Eslint is essentially a tool with a built-in parser. It can parse project code into AST, then analyze the problems in the code based on the AST abstract syntax tree and then give warnings or errors. The original intention of eslint is to detect existing errors as early as possible in the code […]
Tag: eslint
69 – vue3 case – 02 – Eslint configuration code style
1. Eslint configuration code style Configuration file.eslintrc.cjs (1). prettier style matching https://prettier.io ①. Single quotes ②. Do not use semicolons ③. Width 80 characters ④. No object | last comma in array ⑤. There is no limit on newline symbols (win mac is inconsistent) (2). The vue component name consists of multiple words (ignoring indexvue) […]
The code format of vue3 background management framework eslint+pretty, and the use of husky
eslint: Responsible for code quality verification, such as console.log cannot be written, alert cannot be written, etc. prettier: responsible for code formatting husky: Provides life cycle hooks for git. For example, we can do some verification work before submitting the code. pretties integration Install dependencies pnpm add [email protected] -D Configuration file Create new .prettierrc { […]
Project configuration vue.config jsconfig babel.config .prettierc .env .eslintrc
.env In the front-end development process of a product, generally speaking, it will go through local development, test scripts, development self-test, test environment, and pre-launch environment before it can be officially released. There may be differences for each environment, such as server address, interface address, websorket address… etc. When switching between environments, different configuration parameters […]
Front-end engineering (editorconfig+ESLint+Prettier+StyleLint+Husky, Commitlint)
Foreword Acknowledgments: Thanks to Lai Technology By studying relevant technical articles and combining your own practice, write a note to record it. Tools used: ide project style (editorconfig) Code inspection (ESLint) Code style (Prettier) StyleLint git submission specifications (Husky, Commitlint) 1. IDE project specifications VSCode searches for the EditorConfig for VS Code plug-in and installs […]
vue3+ts project 02-install eslint, prettier and sass
Create project Project creation Install eslint yarn add eslint -D Generate configuration file npx eslint –init Install other plugins yarn add -D eslint-plugin-import eslint-plugin-vue eslint-plugin-node eslint-plugin-prettier eslint-config-prettier eslint-plugin-node @babel/eslint-parser vue-eslint-parser Modify .eslintrc.cjs module.exports = {<!– –> env: {<!– –> browser: true, es2021: true, node: true, jest: true, }, /* Specify how to parse the grammar […]
Globally configure Eslint to implement Standard so that it can be used across all Vue projects
Reposted from my personal blog As for why a novice like me, who has only been exposed to the front-end for a few days, wants to talk about this briefly, it’s a long story. It took me a long time to configure all the eslint settings. In order to maintain the standard js code format […]
Front-end project configuration prettier, eslint, lint-stages, husky, commitlint, style-lint set code writing and submission specifications
prettier Chinese website: Options · Prettier Chinese website eslint Chinese website: ESLint Chinese website github husky: https://github.com/typicode/husky commitlint.js official website: commitlint – Lint commit messages, github: GitHub – conventional-changelog/commitlint: Lint commit messages style-lint:Configuring | Stylelint github lint-staged: https://github.com/okonet/lint-staged prettier: Main functions: Format code, create new configuration files for more fine-grained configuration .prettierrc (see official website, […]
Use ESlint and lint-staged to semi-automatically improve project code quality
Recently, I have deployed ESlint and some supporting tools in the project, such as prettier husky lint-staged, and I have some thoughts. Write it down and share it. According to this article, you can reformat the code at the time of git commit, and perform code inspection to prevent some low-level errors. Ultimately, it is […]
[AST] Teach you how to write Eslint plug-in
Foreword Although there are many practical ESLint plug-ins now, as the project continues to iterate and develop, you may encounter a situation where the existing ESLint plug-ins cannot meet the current team development. At this time, you need to create an ESLint plug-in yourself. In this article, I will take you through the general history […]