Skip to content

Opinionated eslint set of rules with support for Vue

License

Notifications You must be signed in to change notification settings

clickbar/eslint-config

Repository files navigation

eslint-config-clickbar

Opinionated eslint set of rules with support for Vue and Typescript. Used in conjunction with prettier.

Usage

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

VS Code config for auto fixing

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
},

License

MIT