Opinionated eslint set of rules with support for Vue and Typescript. Used in conjunction with prettier.
Install dependencies.
pnpm add -D eslint @clickbar/eslint-config
pnpm add -D --save-exact prettier
Add the scripts to your package.json
scripts
:
"scripts": {
"fix": "pnpm lint --fix && pnpm format",
"format": "pnpm prettier --write",
"lint": "eslint .",
"prettier": "prettier . --cache",
"test": "pnpm lint && pnpm prettier --check"
},
Edit eslint.config.js
:
/* eslint-env node */
import clickbar from '@clickbar/eslint-config'
export default clickbar()
If not present, also create a .prettierignore
:
# Laravel
public
vendor
storage
*.d.ts
composer.json
composer.lock
pnpm-lock.yaml
Make sure you also install the Prettier extension and add the following to your settings.json
:
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
MIT