-
- Downloads

add Husky to automatically lint and format things with Prettier

parent
fbaedac0
No related branches found
No related tags found
Showing
- .eslintcache 1 addition, 0 deletions.eslintcache
- .eslintrc 3 additions, 2 deletions.eslintrc
- app/cli.ts 103 additions, 57 deletionsapp/cli.ts
- app/lib/common-libs/moment.ts 2 additions, 2 deletionsapp/lib/common-libs/moment.ts
- package.json 18 additions, 0 deletionspackage.json
- yarn.lock 558 additions, 12 deletionsyarn.lock
.eslintcache
0 → 100644
... | ... | @@ -30,6 +30,11 @@ |
"test": "nyc --reporter html mocha", | ||
"start": "node bin/duniter start", | ||
"build": "tsc && cd \"node_modules/duniter-ui\" && npm install && npm run build", | ||
"lint": "lint-staged", | ||
"prettier": "prettier --write app/**/*/*.ts", | ||
"reformat": "eslint --cache --fix app/**/*/*.ts", | ||
"format:check": "prettier --list-different \"app/**/*.{jsx,ts,tsx,json}\"", | ||
"format:all": "prettier --write \"app/**/*.{jsx,ts,tsx,json}\"", | ||
"test-travis": "nyc --reporter lcovonly mocha test/" | ||
}, | ||
"nyc": { | ||
... | ... | @@ -91,6 +96,7 @@ |
"node-pre-gyp": "0.6.34", | ||
"node-uuid": "1.4.8", | ||
"optimist": "0.6.1", | ||
"prettier": "^2.0.4", | ||
"q-io": "^1.13.5", | ||
"querablep": "^0.1.0", | ||
"request": "2.81.0", | ||
... | ... | @@ -119,6 +125,8 @@ |
"coveralls": "2.11.4", | ||
"eslint": "4.18.2", | ||
"eslint-plugin-mocha": "4.8.0", | ||
"husky": ">=4", | ||
"lint-staged": ">=10", | ||
"mocha": "^3.4.2", | ||
"mocha-eslint": "0.1.7", | ||
"nyc": "^11.0.3", | ||
... | ... | @@ -133,5 +141,15 @@ |
"peerDependencies": {}, | ||
"bin": { | ||
"duniter": "./bin/duniter" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"app/**/*.{js,jsx,ts,tsx,md,html,css,scss}": [ | ||
"prettier --write" | ||
] | ||
} | ||
} |
This diff is collapsed.
Please register or sign in to comment