From 4bdd33932687b6eb4675d3fa1ad17c5dc91666f2 Mon Sep 17 00:00:00 2001 From: Yuriy Maksymets <iurii.maksymets@gmail.com> Date: Thu, 10 Oct 2019 11:07:43 +0100 Subject: [PATCH] Prettier config --- .prettierrc.js | 9 ++++++++- README.md | 12 ++++++++++++ public/index.html | 6 +++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index 8ef0f99..7f21303 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,3 +1,10 @@ module.exports = { - semi: false + semi: false, + printWidth: 80, + tabWidth: 2, + useTabs: false, + singleQuote: false, + trailingComma: "all", + arrowParens: "always", + endOfLine: "lf", } diff --git a/README.md b/README.md index b9fedbb..54ed159 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,18 @@ Open the developer console to find out your client's ID. To connect to another p >> window.connectToPeer("peer-id") ``` +## Development + +### Precommit Checks + +The project is supplied with a `.pre-commit-config.yml`. This file defines the checks that [pre-commit](https://pre-commit.com/) must execute on every `git commit`. +To use pre-commit (RECOMMENDED): + +1. Install it, following the instructions available at the link provided; +2. Hook it to the project, by running `pre-commit install` from the project's root directory. + Whenever a pre-commit check fails, it fixes the code in place for you and aborts the commit. + You therefore have to `git add .` and reissue the `git commit` command. + ## License MIT diff --git a/public/index.html b/public/index.html index 514e925..338342d 100644 --- a/public/index.html +++ b/public/index.html @@ -31,7 +31,7 @@ var mouse = { x: e.offsetX, - y: e.offsetY + y: e.offsetY, } path = document.createElementNS("http://www.w3.org/2000/svg", "path") @@ -52,13 +52,13 @@ whiteboard.onmousemove = function(e) { var mouse = { x: e.offsetX, - y: e.offsetY + y: e.offsetY, } if (painting) { path.setAttribute( "d", - path.getAttribute("d") + " L" + mouse.x + " " + mouse.y + path.getAttribute("d") + " L" + mouse.x + " " + mouse.y, ) } } -- GitLab