Keep same code style (important for beginners and big teams)
Helps you spot issues during the development phase
Works with TypeScript and JavaScript
Simply install the EsLint extension
npx eslint --init
npx eslint src
npx eslint src --fix
npm i eslint-plugin-react-hooks -D
"extends": [... , "plugin:react-hooks/recommended"]
An opinionated code formatter
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
File -> Preferences -> Settings -> Format On Save
The solution:
npm i eslint-config-prettier -D
Check your spelling in an easy way
Control your bundlesize right in your code
Automation that makes your life easier
npm i husky -D
npm set-script prepare "husky install"
npx husky install
npx husky add .husky/pre-commit "npm run lint"
npm install --save-dev lint-staged
{
"*.ts[x]": "eslint"
}
Big amount of tasks might negatively impact developer experience. To avoid this - add task one by one and consult with the team
The way to write less HTML but get more
Simply put . and hit tab
div>span+span
div*3
div[test-id]
Automate your routine as you wish
"Hello World": {
"scope": "typescriptreact,javascriptreact",
"prefix": "hw",
"body": ["hello world"],
"description": "Creates siple hello world text"
}
"React functional component": {
"scope": "typescriptreact,javascriptreact",
"prefix": "rfc",
"body": ["export const $1 = ($2) =>{\r\n return ($3)\r\n}"],
"description": "Creates react function component"
}