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) […]

lintcode3722 · Calculate the distance between two binary tree nodes [medium in-order traversal + find the nearest common ancestor of the two nodes]

Title https://www.lintcode.com/problem/3722 Given the root node root of a binary tree and the values p and q of two nodes in the tree, you need to calculate the distance between the two corresponding nodes of p and q in the binary tree, and add it return. The distance between two nodes in a binary tree […]

Solve import matplotlib; matplotlib.use(Agg) # pylint: disable=multiple-statements

Table of Contents Solve import matplotlib; matplotlib.use(‘Agg’) # pylint: disable=multiple-statements Background of the problem solution Summarize Solve import matplotlib; matplotlib.use(‘Agg’) # pylint: disable=multiple-statements In the field of data visualization in Python, matplotlib is a very powerful and popular library. However, sometimes in the process of using ??matplotlib??, we may encounter some problems. For example, in […]

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 […]

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, […]