Commit 84365e59 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Set up husky and lint-staged.

No related merge requests found
Showing with 14 additions and 6 deletions
+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"
} }
} }
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
"rxjs-tslint-rules", "rxjs-tslint-rules",
"tslint-config-prettier" "tslint-config-prettier"
], ],
"rulesDirectory": [ "rulesDirectory": ["codelyzer", "tslint-defocus", "tslint-plugin-prettier"],
"codelyzer",
"tslint-defocus",
"tslint-plugin-prettier"
],
"rules": { "rules": {
"arrow-return-shorthand": true, "arrow-return-shorthand": true,
"array-type": [true, "array-simple"], "array-type": [true, "array-simple"],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment