0.0.3 • Published 9 months ago

@kevinmarrec/eslint-config v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@kevinmarrec/eslint-config

npm version npm downloads Github Actions

Based on @antfu/eslint-config by Anthony Fu :

  • Single quotes, no semi
  • Auto fix for formatting (aimed to be used standalone without Prettier)
  • Designed to work with TypeScript, Vue out-of-box
  • Lint also for json, yaml, markdown
  • Sorted imports, dangling commas for cleaner commit diff
  • Reasonable defaults, best practices, only one-line of config

Additionnally, this configuration overrides some rules to match my personal preferences :

  • @typescript-eslint/no-unused-vars : Warning (warn) instead of Error (error)
  • @typescript-eslint/space-before-function-paren : Set to always for spaces before function parenthesis

Usage

Install

pnpm add -D eslint @kevinmarrec/eslint-config

Config .eslintrc

{
  "extends": "@kevinmarrec"
}

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Config VS Code auto fix

Install VS Code ESLint extension and create .vscode/settings.json

{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

Copyright

This configuration is based on @antfu/eslint-config by Anthony Fu

License

Made with ❤️

Published under the MIT License