https://github.com/will-stone/eslint-config
https://github.com/will-stone/eslint-config
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/will-stone/eslint-config
- Owner: will-stone
- License: mit
- Created: 2023-10-07T17:03:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-28T20:11:26.000Z (about 2 years ago)
- Last Synced: 2024-05-02T06:00:37.784Z (about 2 years ago)
- Language: TypeScript
- Size: 173 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @will-stone/eslint-config
My personal [ESLint](https://eslint.org/) config.
## Usage
### Install
```bash
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
```js
// eslint.config.js
import config from '@will-stone/eslint-config'
export default config()
```
### Add script for package.json
For example:
```json
{
"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`:
```json
{
"lint-staged": {
"*.{js,jsx,ts,tsx,json}": ["eslint --fix"]
}
}
```
and then
```bash
pnpm add -D husky lint-staged
pnpm husky init
echo "lint-staged" > .husky/pre-commit
```
## Credits
Inspired by the excellent [Flat eslint-config](https://github.com/antfu/eslint-config) by
[Anthony Fu](https://github.com/antfu).