Skip to content

will-stone/eslint-config

Repository files navigation

@will-stone/eslint-config

My personal ESLint config.

Usage

Install

pnpm add -D eslint @will-stone/eslint-config

Optional Peer Dependencies

If you are using any of the following packages, you will also need to install the corresponding plugin.

Package Plugin
astro astro-eslint-parser eslint-plugin-astro
react eslint-plugin-react eslint-plugin-react-hooks
tailwindcss eslint-plugin-tailwindcss
vitest @vitest/eslint-plugin

Create config file

// eslint.config.js
import config from '@will-stone/eslint-config'

export default config()

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint ."
  }
}

Lint Staged

If you would like to apply lint and auto-fix before every commit, you can add the following to your package.json:

{
  "lint-staged": {
    "*.{js,jsx,ts,tsx,json}": ["eslint --fix"]
  }
}

and then

pnpm add -D husky lint-staged
pnpm husky init
echo "lint-staged" > .husky/pre-commit

Credits

Inspired by the excellent Flat eslint-config by Anthony Fu.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •