1.4.0 • Published 2 years ago
@ahqrt/eslint-config-react-typescript v1.4.0
@ahqrt/eslint-config-react-typescript
TODO: description
Install
yarn add -D eslint prettier @ahqrt/eslint-config-react-typescript @ahqrt/prettier-config lint-staged yorkie
手动配置
.eslintrc.js
module.exports = {
root: true,
extends: ['@ahqrt/eslint-config-react-typescript'],
};
.prettierrc.js
module.exports = require('@ahqrt/prettier-config')
.editorconfig
# 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
pre-commit lint
####package.json
{
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": ["eslint --fix"],
"**/*.{md,json}": ["prettier --write"]
}
}
.vscode/settings.json
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
}