From a61debebb401b4484f1314461544021e59f8066e Mon Sep 17 00:00:00 2001 From: Florent Chehab Date: Thu, 7 May 2020 21:43:13 +0200 Subject: [PATCH] feat: configured prettier, pretty-quick and husky --- .editorconfig | 2 +- .prettierrc.json | 3 +++ package.json | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .prettierrc.json diff --git a/.editorconfig b/.editorconfig index 76617ce..d41152b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,5 +8,5 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[{*.js,*.css}] +[{*.js,*.css,*.html}] indent_size = 4 diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..de753c5 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "printWidth": 100 +} diff --git a/package.json b/package.json index f8b3168..3a99b54 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "build": "webpack --config config/webpack.build.js", "start:dev": "node scripts/server.js --mode=development", "start:prod": "npm run build && node scripts/server.js --mode=production", - "test": "echo \"No tests needed!\" && exit 1" + "test": "echo \"No tests needed!\" && exit 1", + "pretty-quick": "pretty-quick", + "format": "prettier --write .", + "style": "prettier --check ." }, "repository": { "type": "git", @@ -19,6 +22,11 @@ "Sketchboard", "lightweight" ], + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + }, "dependencies": { "dompurify": "^2.0.7", "express": "4.*",