From 314b1818d744a1e71aa24cd545d7dcefe9ceb8b6 Mon Sep 17 00:00:00 2001 From: Alexander Roidl <34438048+alexanderroidl@users.noreply.github.com> Date: Tue, 22 Jul 2025 21:39:52 +0200 Subject: [PATCH] Formatting and linting pre-commit hook (#143) --- .prettierrc | 4 ++++ package.json | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0981b7c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "singleQuote": true, + "printWidth": 120 +} diff --git a/package.json b/package.json index 12ed26a..c8f2b89 100755 --- a/package.json +++ b/package.json @@ -3,19 +3,20 @@ "version": "11.2.6", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { + "prepare": "husky", "start": "node prod.js", "dev": "yarn && rm -rf ./ui/public/* && vite", "ui": "rm -rf ./ui/public/* && vite", "prod": "yarn && vite build --emptyOutDir", - "format": "prettier --write lib/**/*.js ui/src/**/*.jsx test/**/*.js *.js --single-quote --print-width 120", + "format": "prettier --write lib/**/*.js ui/src/**/*.jsx test/**/*.js *.js", "test": "mocha --loader=esmock --timeout 3000000 test/**/*.test.js", - "lint": "eslint ./index.js ./lib/**/*.js ./test/**/*.js ./ui/src/**/*.jsx" + "lint": "eslint index.js lib/**/*.js test/**/*.js ui/src/**/*.jsx --fix" }, "type": "module", "lint-staged": { - "*.js": [ - "eslint ./index.js ./lib/**/*.js ./test/**/*.js", - "prettier --single-quote --print-width 120 --write" + "*.{js,jsx}": [ + "yarn lint", + "yarn format" ] }, "main": "index.js",