Opinionable configs
pnpm add eslint typescript @ntnyq/eslint-config prettier @ntnyq/prettier-config -D
Create a file .eslintrc.json
in project root:
{
"root": true,
"extends": ["@ntnyq"]
}
Add lint scripts in package.json
:
{
"scripts": {
"lint": "eslint ."
}
}
Intergrated with VS Code:
{
"prettier.enable": true,
"eslint.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.validate": [
"vue",
"html",
"yaml",
"json",
"jsonc",
"json5",
"markdown",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact"
]
}
pnpm add prettier @ntnyq/prettier-config -D
Config in package.json
:
{
"prettier": "@ntnyq/prettier-config"
}