An open API service indexing awesome lists of open source software.

https://github.com/sudongyuer/eslint-config

🐇 Out of box Eslint config ~~
https://github.com/sudongyuer/eslint-config

eslint eslint-config eslint-config-react eslint-config-typescript eslint-config-vue formatter lint linter

Last synced: 3 months ago
JSON representation

🐇 Out of box Eslint config ~~

Awesome Lists containing this project

README

        

# @sudongyuer/eslint-config





- Single quotes, no semi
- Auto fix for formatting (aimed to be used standalone without Prettier)
- TypeScript, Vue, React 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

## Usage

### Install

```bash
pnpm add -D eslint @sudongyuer/eslint-config
```

### Config `.eslintrc`

```json
{
"extends": "@sudongyuer"
}
```

> You don't need `.eslintignore` normally as it has been provided by the preset.

### Add script for package.json

For example:

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

### Config WebStorm auto fix

![](https://tva1.sinaimg.cn/large/e6c9d24egy1h3tvp96c74j212l0u077u.jpg)

### Config VS Code auto fix

Create `.vscode/settings.json`

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

## Author

sudongyuer email:[email protected]

## License

MIT