Formatting and linting pre-commit hook (#143)

This commit is contained in:
Alexander Roidl
2025-07-22 21:39:52 +02:00
committed by GitHub
parent 25cc7fb650
commit 314b1818d7
2 changed files with 10 additions and 5 deletions

4
.prettierrc Normal file
View File

@@ -0,0 +1,4 @@
{
"singleQuote": true,
"printWidth": 120
}

View File

@@ -3,19 +3,20 @@
"version": "11.2.6", "version": "11.2.6",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].", "description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": { "scripts": {
"prepare": "husky",
"start": "node prod.js", "start": "node prod.js",
"dev": "yarn && rm -rf ./ui/public/* && vite", "dev": "yarn && rm -rf ./ui/public/* && vite",
"ui": "rm -rf ./ui/public/* && vite", "ui": "rm -rf ./ui/public/* && vite",
"prod": "yarn && vite build --emptyOutDir", "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", "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", "type": "module",
"lint-staged": { "lint-staged": {
"*.js": [ "*.{js,jsx}": [
"eslint ./index.js ./lib/**/*.js ./test/**/*.js", "yarn lint",
"prettier --single-quote --print-width 120 --write" "yarn format"
] ]
}, },
"main": "index.js", "main": "index.js",