[setup][s]-setup code formatting with prettier

- add husky and lint-stages for pre-commit hooks
 - format entire codebase using `yarn format`
This commit is contained in:
Gift Egwuenu
2020-06-17 13:00:54 +01:00
parent 2ecd88388a
commit 5de8ace421
35 changed files with 1038 additions and 628 deletions

View File

@@ -8,7 +8,9 @@
"start": "next start",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
"test:coverage": "jest --coverage",
"format": "prettier --single-quote --write .",
"pre-comit": "echo 'formating your changes.....' && prettier --single-quote --write"
},
"dependencies": {
"bytes": "^3.1.0",
@@ -26,12 +28,23 @@
"@types/react": "^16.9.35",
"babel-jest": "^26.0.1",
"dotenv": "^8.2.0",
"husky": ">=4",
"jest": "^26.0.1",
"lint-staged": ">=10",
"nconf": "^0.10.0",
"nock": "^12.0.3",
"postcss-preset-env": "^6.7.0",
"prettier": "2.0.5",
"react-test-renderer": "^16.13.1",
"tailwindcss": "^1.4.6",
"typescript": "^3.9.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,css,html,tsx}": "yarn pre-comit"
}
}