From 92708ead217f41f029207def4c9c6c949b385cbf Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 7 Aug 2023 19:48:42 +0200 Subject: [PATCH] Add format command for those not running prettier in editor --- www/package-lock.json | 16 ++++++++++++++++ www/package.json | 2 ++ 2 files changed, 18 insertions(+) diff --git a/www/package-lock.json b/www/package-lock.json index dfa378b3b..49ee8a8ea 100644 --- a/www/package-lock.json +++ b/www/package-lock.json @@ -38,6 +38,7 @@ "eslint-plugin-react-refresh": "^0.4.1", "express": "^4.18.2", "nodemon": "^2.0.22", + "prettier": "^3.0.1", "sass": "^1.62.1", "source-map-explorer": "^2.5.3", "vite": "^4.3.9" @@ -4204,6 +4205,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.1.tgz", + "integrity": "sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", diff --git a/www/package.json b/www/package.json index add591890..2a62f13c1 100644 --- a/www/package.json +++ b/www/package.json @@ -27,6 +27,7 @@ "build": "vite build && npm run makefsdata", "dev-server": "nodemon -r dotenv/config ./server/app.js", "dev": "concurrently --kill-others \"npm run dev-server\" \"npm start\"", + "format": "prettier --write \"{src,server}/**/*.{tsx,ts,jsx,js,json,scss}\"", "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", "makefsdata": "node makefsdata.js", "start": "vite" @@ -43,6 +44,7 @@ "eslint-plugin-react-refresh": "^0.4.1", "express": "^4.18.2", "nodemon": "^2.0.22", + "prettier": "^3.0.1", "sass": "^1.62.1", "source-map-explorer": "^2.5.3", "vite": "^4.3.9"