Set up husky and lint-staged.
Showing
+14 -6
... | @@ -27,6 +27,8 @@ | ... | @@ -27,6 +27,8 @@ |
"devDependencies": { | "devDependencies": { | ||
"@angular/compiler": "^8.2.9", | "@angular/compiler": "^8.2.9", | ||
"@angular/core": "^8.2.9", | "@angular/core": "^8.2.9", | ||
"husky": "^3.0.8", | |||
"lint-staged": "^10.0.0-0", | |||
"prettier": "^1.15.0", | "prettier": "^1.15.0", | ||
"rxjs": "^6", | "rxjs": "^6", | ||
"tslint": "^5.9.1", | "tslint": "^5.9.1", | ||
... | @@ -35,6 +37,16 @@ | ... | @@ -35,6 +37,16 @@ |
}, | }, | ||
"scripts": { | "scripts": { | ||
"test": "tslint -p tsconfig.json --print-config tsconfig.json >/dev/null", | "test": "tslint -p tsconfig.json --print-config tsconfig.json >/dev/null", | ||
"lint": "prettier --check '*.js' '*.json'" | "lint": "prettier --check *.js *.json", | ||
"lint:fix": "prettier --write *.js *.json" | |||
}, | |||
"husky": { | |||
"hooks": { | |||
"pre-commit": "lint-staged" | |||
} | |||
}, | |||
"lint-staged": { | |||
"*.js": "npm run lint:fix", | |||
"*.json": "npm run lint:fix" | |||
} | } | ||
} | } |
Please register or sign in to comment