From 24f020f1a0b297ab17c13f25a0fbc30f0d416a50 Mon Sep 17 00:00:00 2001 From: Ibrahim Ansari Date: Tue, 5 Nov 2024 18:17:33 +0530 Subject: [PATCH] Move Prettier conf to package.json, clean TODOs --- .prettierrc.js | 8 -------- .yarnrc.yml | 2 +- app/dd.go | 6 +----- app/devices_darwin.go | 2 +- app/devices_unix.go | 2 +- app/devices_windows.go | 2 +- app/execdd.go | 2 +- main.go | 6 +++--- package.json | 36 ++++++++++++++++++++++-------------- renderer/App.tsx | 2 +- renderer/index.tsx | 2 +- 11 files changed, 33 insertions(+), 37 deletions(-) delete mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 8df38e8..0000000 --- a/.prettierrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - printWidth: 100, - arrowParens: 'avoid', - singleQuote: true, - semi: false, - jsxSingleQuote: true, - endOfLine: 'auto', -} diff --git a/.yarnrc.yml b/.yarnrc.yml index 6d1ea5f..f2bd681 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,4 +1,4 @@ -# LOW-TODO: Remove this file once workaround is no longer needed. +# TODO: Remove this file once workaround is no longer needed. compressionLevel: mixed enableGlobalCache: false packageExtensions: diff --git a/app/dd.go b/app/dd.go index 3230d3f..1e529be 100644 --- a/app/dd.go +++ b/app/dd.go @@ -8,7 +8,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "strconv" "strings" "time" @@ -84,10 +83,7 @@ func FlashFileToBlockDevice(iff string, of string) { } else if destStat.Mode().IsDir() { log.Fatalln("The specified destination is a directory!") } - bs := 4096 - if runtime.GOOS == "windows" { - bs = 512 // TODO: Is this true? - } + bs := 4 * 1024 * 1024 // TODO: Allow configurability? timer := time.NewTimer(time.Second) startTime := time.Now().UnixMilli() var total int diff --git a/app/devices_darwin.go b/app/devices_darwin.go index 1f0ec5b..d20cff1 100644 --- a/app/devices_darwin.go +++ b/app/devices_darwin.go @@ -69,6 +69,6 @@ func UnmountDevice(device string) error { } else if stat.Mode().Type()&fs.ModeDevice == 0 { return ErrNotBlockDevice } - // TODO: Discover device partitions and recursively unmount them. + // FIXME: Discover device partitions and recursively unmount them. return nil } diff --git a/app/devices_unix.go b/app/devices_unix.go index bfaa116..086eee1 100644 --- a/app/devices_unix.go +++ b/app/devices_unix.go @@ -71,6 +71,6 @@ func UnmountDevice(device string) error { } else if stat.Mode().Type()&fs.ModeDevice == 0 { return ErrNotBlockDevice } - // TODO: Discover device partitions and recursively unmount them. + // FIXME: Discover device partitions and recursively unmount them. return nil } diff --git a/app/devices_windows.go b/app/devices_windows.go index 0479242..7b0c4b1 100644 --- a/app/devices_windows.go +++ b/app/devices_windows.go @@ -68,6 +68,6 @@ func UnmountDevice(device string) error { } else if stat.Mode().Type()&fs.ModeDevice == 0 { return ErrNotBlockDevice } - // TODO: Discover device partitions and recursively unmount them. + // FIXME: Discover device partitions and recursively unmount them. return nil } diff --git a/app/execdd.go b/app/execdd.go index 3958c75..bb252c3 100644 --- a/app/execdd.go +++ b/app/execdd.go @@ -93,7 +93,7 @@ func CopyConvert(iff string, of string) (chan DdProgress, io.WriteCloser, error) lastLine = text firstSpace := strings.Index(text, " ") if firstSpace != -1 && strings.HasPrefix(text[firstSpace+1:], "bytes (") { - // LOW-TODO: Probably handle error, but we can't tell full dd behavior without seeing the code. + // TODO: Probably handle error, but we can't tell full dd behavior without seeing the code. // Well, custom dd is the default now anyways. bytes, _ := strconv.Atoi(text[:firstSpace]) split := strings.Split(text, ", ") diff --git a/main.go b/main.go index abc4631..4372e92 100644 --- a/main.go +++ b/main.go @@ -18,9 +18,9 @@ import ( webview "github.com/webview/webview_go" ) -// TODO: Design UI (with live warnings/errors). -// TODO: Validate written image. -// LOW-TODO: Future support for flashing to an internal drive? +// FIXME: Design UI (with live warnings/errors). +// FIXME: Validate written image. +// TODO: Future support for flashing to an internal drive? const version = "1.0.0-alpha.2" diff --git a/package.json b/package.json index 474cf65..8e1dfe2 100644 --- a/package.json +++ b/package.json @@ -6,20 +6,6 @@ "author": "retrixe", "license": "Apache-2.0", "private": true, - "engines": { - "browsers": "ie >= 9" - }, - "output": "dist/index.js", - "targets": { - "output": { - "context": "browser", - "outputFormat": "global", - "sourceMap": { - "inline": true, - "inlineSources": true - } - } - }, "scripts": { "lint": "eslint . && tsc --noEmit", "dev": "parcel renderer/index.html & go run -ldflags=\"-s -w -X main.overrideUrl=http://localhost:1234/\" . & echo Starting...", @@ -64,5 +50,27 @@ "process": "^0.11.10", "run-script-os": "^1.1.6", "typescript": "^5.6.3" + }, + "engines": { + "browsers": "ie >= 9" + }, + "output": "dist/index.js", + "targets": { + "output": { + "context": "browser", + "outputFormat": "global", + "sourceMap": { + "inline": true, + "inlineSources": true + } + } + }, + "prettier": { + "printWidth": 100, + "arrowParens": "avoid", + "singleQuote": true, + "jsxSingleQuote": true, + "semi": false, + "endOfLine": "auto" } } diff --git a/renderer/App.tsx b/renderer/App.tsx index 7e06e14..519d35b 100644 --- a/renderer/App.tsx +++ b/renderer/App.tsx @@ -25,7 +25,7 @@ const App = (): JSX.Element => { useEffect(() => setConfirm(false), [inProgress]) const onFlashButtonClick = (): void => { if (inProgress) { - // TODO: A dialog would be better. + // FIXME: A dialog would be better. if (confirm) { setConfirm(false) globalThis.cancelFlash() diff --git a/renderer/index.tsx b/renderer/index.tsx index 142b36b..2fe70d1 100644 --- a/renderer/index.tsx +++ b/renderer/index.tsx @@ -18,7 +18,7 @@ declare global { var setSelectedDeviceReact: (selectedDevice: string) => void } /* eslint-enable no-var */ -// LOW-TODO: Use SWC Emotion plugin in future once Parcel reads .swcrc files... +// TODO: Use SWC Emotion plugin in future once Parcel reads .swcrc files... const el = document.getElementById('app') if (el !== null) { createRoot(el).render()