mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Merge pull request #833 from c-bata/biome-ci-vscode
[vscode] Use `biome ci` instead of `eslint`
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
venv
|
||||
.venv
|
||||
standalone_app
|
||||
standalone_app
|
||||
vscode
|
||||
+2
-2
@@ -5,10 +5,10 @@
|
||||
"description": "Dashboard for Optuna",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"fmt": "biome format --write . && biome check standalone_app --apply",
|
||||
"fmt": "biome format --write . && biome check standalone_app vscode --apply",
|
||||
"lint": "npm run lint:eslint && npm run lint:biome",
|
||||
"lint:eslint": "eslint . --ext .ts,.tsx --max-warnings 0",
|
||||
"lint:biome": "biome format . && biome ci standalone_app",
|
||||
"lint:biome": "biome format . && biome ci standalone_app vscode",
|
||||
"watch": "NODE_ENV=development TYPESCRIPT_LOADER=esbuild-loader webpack --watch",
|
||||
"build": "webpack",
|
||||
"build:dev": "NODE_ENV=development TYPESCRIPT_LOADER=esbuild-loader webpack",
|
||||
|
||||
@@ -5,7 +5,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
'Congratulations, your extension "optuna-dashboard" is now active in the web extension host!'
|
||||
)
|
||||
|
||||
let disposable = vscode.commands.registerCommand(
|
||||
const disposable = vscode.commands.registerCommand(
|
||||
"optuna-dashboard.openOptunaDashboard",
|
||||
async (fileUri: vscode.Uri) => {
|
||||
// In VS Code, the path separator of fileUri is always '/'
|
||||
@@ -30,15 +30,17 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const appPath = panel.webview.asWebviewUri(indexJsUri)
|
||||
|
||||
panel.webview.html = getWebviewContent(appPath)
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>`
|
||||
panel.webview.onDidReceiveMessage(async (message: any) => {
|
||||
switch (message.type) {
|
||||
case "webviewDidLoad":
|
||||
case "webviewDidLoad": {
|
||||
const storageContentBase64 = await readFileAsBase64(fileUri)
|
||||
panel.webview.postMessage({
|
||||
type: "optunaStorage",
|
||||
content: storageContentBase64,
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -55,9 +57,7 @@ async function readFileAsBase64(uri: vscode.Uri): Promise<string> {
|
||||
|
||||
function uint8ArrayToBase64(uint8Array: Uint8Array): string {
|
||||
const binString = Array.prototype.map
|
||||
.call(uint8Array, function (ch) {
|
||||
return String.fromCharCode(ch)
|
||||
})
|
||||
.call(uint8Array, (ch) => String.fromCharCode(ch))
|
||||
.join("")
|
||||
return btoa(binString)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user