@youngjuning/eslint-config
Version:
youngjuning's eslint config
80 lines (58 loc) • 1.47 kB
Markdown
# @youngjuning/eslint-config
## Install
```sh
pnpm add -D eslint prettier @youngjuning/eslint-config @youngjuning/prettier-config lint-staged yorkie
```
## 手动配置
### eslint.config.js
> vscode extension: [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
```js
import youngjuning from '@youngjuning/eslint-config';
export default [...youngjuning];
```
### .prettierrc.js
```js
module.exports = require('@youngjuning/prettier-config');
```
### .editorconfig
> vscode extension: [editorconfig.editorconfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
```txt
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
quote_type = single # Fix Prettier "prettier.singleQuote" not working in 1.40 vs code
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
```
### pre-commit lint
#### package.json
```json
{
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": ["eslint --fix"],
"**/*.{md,json}": ["prettier --write"]
}
}
```
#### .vscode/settings.json
```js
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}
```