From 8de2b0031720a60772e00506ec2dc8c954bbc64a Mon Sep 17 00:00:00 2001 From: Tyler VanZanten Date: Tue, 15 Oct 2024 15:25:34 -0400 Subject: [PATCH] Reformat JavaScript and TypeScript files with Prettier (#1192) --- www/package-lock.json | 9 +- www/package.json | 2 +- www/src/Addons/I2CAnalog1219.tsx | 3 +- www/src/Addons/Keyboard.tsx | 68 ++++----- www/src/Addons/ReactiveLED.tsx | 181 ++++++++++++++---------- www/src/Components/CaptureButton.tsx | 2 +- www/src/Components/KeyboardMapper.jsx | 4 +- www/src/Components/Navigation.jsx | 12 +- www/src/Locales/zh-CN/PinMapping.jsx | 9 +- www/src/Pages/AddonsConfigPage.jsx | 5 +- www/src/Pages/HomePage.jsx | 10 +- www/src/Pages/InputMacroAddonPage.tsx | 10 +- www/src/Pages/PeripheralMappingPage.jsx | 2 +- www/src/Pages/PinMapping.tsx | 6 +- www/src/Pages/SettingsPage.jsx | 8 +- www/src/Store/useProfilesStore.ts | 2 +- www/vite.config.ts | 2 +- 17 files changed, 191 insertions(+), 144 deletions(-) diff --git a/www/package-lock.json b/www/package-lock.json index 34f13ce52..2b59f5f5c 100644 --- a/www/package-lock.json +++ b/www/package-lock.json @@ -44,7 +44,7 @@ "express": "^4.18.2", "nodemon": "^2.0.22", "pako": "^2.1.0", - "prettier": "^3.0.1", + "prettier": "^3.3.3", "sass": "^1.62.1", "typescript": "^5.3.3", "vite": "^4.3.9" @@ -4588,10 +4588,11 @@ } }, "node_modules/prettier": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.1.tgz", - "integrity": "sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/www/package.json b/www/package.json index f5a30ee9b..651020f1a 100644 --- a/www/package.json +++ b/www/package.json @@ -51,7 +51,7 @@ "express": "^4.18.2", "nodemon": "^2.0.22", "pako": "^2.1.0", - "prettier": "^3.0.1", + "prettier": "^3.3.3", "sass": "^1.62.1", "typescript": "^5.3.3", "vite": "^4.3.9" diff --git a/www/src/Addons/I2CAnalog1219.tsx b/www/src/Addons/I2CAnalog1219.tsx index 6bd427643..1c428e51f 100644 --- a/www/src/Addons/I2CAnalog1219.tsx +++ b/www/src/Addons/I2CAnalog1219.tsx @@ -36,8 +36,7 @@ const I2CAnalog1219 = ({ values, errors, handleChange, handleCheckbox }) => { hidden={ !(values.I2CAnalog1219InputEnabled && getAvailablePeripherals('i2c')) } - > - + > {getAvailablePeripherals('i2c') ? ( ({ - label: key, - value, - })); +const options = Object.entries(BUTTON_ACTIONS).map(([key, value]) => ({ + label: key, + value, +})); const excludedButtons = [ - 'E1','E2','E3','E4', - 'E5','E6','E7','E8', - 'E9','E10','E11','E12', + 'E1', + 'E2', + 'E3', + 'E4', + 'E5', + 'E6', + 'E7', + 'E8', + 'E9', + 'E10', + 'E11', + 'E12', ]; const Keyboard = ({ @@ -95,7 +112,7 @@ const Keyboard = ({

{t('AddonsConfig:keyboard-host-mouse-header-text')}

-
+
{BUTTON_MASKS_OPTIONS.map((o, i) => ( - ))}
-
+
{BUTTON_MASKS_OPTIONS.map((o, i) => ( - ))}
-
+
{BUTTON_MASKS_OPTIONS.map((o, i) => ( - ))} diff --git a/www/src/Addons/ReactiveLED.tsx b/www/src/Addons/ReactiveLED.tsx index 7f2225f22..1c978d179 100644 --- a/www/src/Addons/ReactiveLED.tsx +++ b/www/src/Addons/ReactiveLED.tsx @@ -12,17 +12,14 @@ import FormSelect from '../Components/FormSelect'; import FormControl from '../Components/FormControl'; import { Button, FormCheck, Row, Col } from 'react-bootstrap'; -import WebApi, { } from '../Services/WebApi'; +import WebApi from '../Services/WebApi'; -import { - BUTTON_ACTIONS, - PinActionValues, -} from '../Data/Pins'; +import { BUTTON_ACTIONS, PinActionValues } from '../Data/Pins'; import { getButtonLabels } from '../Data/Buttons'; const NON_SELECTABLE_BUTTON_ACTIONS = [ -5, 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40 + 37, 38, 39, 40, ]; const REACTIVE_LED_MODES = [ @@ -72,82 +69,124 @@ const ReactiveLED = ({ values, errors, handleChange, handleCheckbox }) => { fetchData(); }, [setSelectedLEDs, selectedLEDs]); - const handleLEDChange = (c : any, idx : Number, field : String, value : Number) => { + const handleLEDChange = ( + c: any, + idx: Number, + field: String, + value: Number, + ) => { c[idx][field] = value; console.dir(c); return [...c]; }; const saveLEDSettings = async () => { - const ledSettings = await WebApi.setReactiveLEDs({leds: reactiveLEDs}); + const ledSettings = await WebApi.setReactiveLEDs({ leds: reactiveLEDs }); }; return (
-