Created
January 19, 2021 07:41
-
-
Save heycqing/55de00e510408fd8d75d1e70436b59c0 to your computer and use it in GitHub Desktop.
在package.json文件中添加针对文件类型的格式化和校验
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "lint": "eslint --ext .js --ext .vue src/", | |
| "lint-fix": "eslint --fix --ext .js --ext .vue src/", | |
| "prettier-fix": "prettier --write 'src/**/*.json' 'src/**/*.md' ", | |
| "husky": { | |
| "hooks": { | |
| "pre-commit": "lint-staged" | |
| } | |
| }, | |
| "lint-staged": { | |
| "src/**/*{.vue,.js}": [ | |
| "prettier --write", | |
| "eslint --fix", | |
| "git add" | |
| ], | |
| "src/**/*{.json,.md,.mdx}": [ | |
| "prettier --write", | |
| "git add" | |
| ], | |
| "src/**/*{.less,.scss,.sass,.css}": [ | |
| "prettier --write", | |
| "git add" | |
| ] | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment