diff --git a/.prettierrc.js b/.prettierrc.js index 8ef0f9962b70f346dc61cc9f80f2789d03bec7fe..7f21303dac28cb40102e6694c01f3215a683fdfe 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 b9fedbbad5d8c06629d1e7d92c5b4a14a7c0f50c..54ed159a9f9a483046ed8ccb3935489ec5c1eef8 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 514e92561cb091a954e9227225faf191854144bc..338342d8f9d5ace189dab9a6805568aa89fe193f 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, ) } }