Skip to content

Commit f1a0d3f

Browse files
committed
style: biome check --write --unsafe
1 parent 431594f commit f1a0d3f

47 files changed

Lines changed: 258 additions & 354 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/check-gs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/// <reference types="node" />
1818

19-
import { exec } from "child_process";
19+
import { exec } from "node:child_process";
2020
import {
2121
copyFileSync,
2222
existsSync,
@@ -25,9 +25,9 @@ import {
2525
rmSync,
2626
statSync,
2727
writeFileSync,
28-
} from "fs";
29-
import { dirname, join, relative, resolve, sep } from "path";
30-
import { promisify } from "util";
28+
} from "node:fs";
29+
import { dirname, join, relative, resolve, sep } from "node:path";
30+
import { promisify } from "node:util";
3131

3232
const execAsync = promisify(exec);
3333
const TEMP_ROOT = ".tsc_check";

ai/autosummarize/gemini.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ function credentialsForVertexAI() {
107107
const parsedCredentials = JSON.parse(credentials);
108108
const service = OAuth2.createService("Vertex")
109109
.setTokenUrl("https://oauth2.googleapis.com/token")
110-
.setPrivateKey(parsedCredentials["private_key"])
111-
.setIssuer(parsedCredentials["client_email"])
110+
.setPrivateKey(parsedCredentials.private_key)
111+
.setIssuer(parsedCredentials.client_email)
112112
.setPropertyStore(PropertiesService.getScriptProperties())
113113
.setScope("https://www.googleapis.com/auth/cloud-platform");
114114
return {
115-
projectId: parsedCredentials["project_id"],
115+
projectId: parsedCredentials.project_id,
116116
accessToken: service.getAccessToken(),
117117
};
118118
}

ai/custom-func-ai-agent/AiVertex.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ function credentialsForVertexAI() {
108108

109109
const service = OAuth2.createService("Vertex")
110110
.setTokenUrl("https://oauth2.googleapis.com/token")
111-
.setPrivateKey(parsedCredentials["private_key"])
112-
.setIssuer(parsedCredentials["client_email"])
111+
.setPrivateKey(parsedCredentials.private_key)
112+
.setIssuer(parsedCredentials.client_email)
113113
.setPropertyStore(PropertiesService.getScriptProperties())
114114
.setScope("https://www.googleapis.com/auth/cloud-platform");
115115
return {
116-
projectId: parsedCredentials["project_id"],
116+
projectId: parsedCredentials.project_id,
117117
accessToken: service.getAccessToken(),
118118
};
119119
}

ai/custom-func-ai-agent/Code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ limitations under the License.
2626
* @customfunction
2727
*/
2828
function FACT_CHECK(statement, outputFormat) {
29-
if (!outputFormat || outputFormat == "") {
29+
if (!outputFormat || outputFormat === "") {
3030
outputFormat =
3131
"Summarize it. Only keep the verdict result and main arguments. " +
3232
"Do not reiterate the fact being checked. Remove all markdown. " +

ai/custom-func-ai-studio/gemini.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ function getAiSummary(prompt) {
6767

6868
const apiKey = PropertiesService.getScriptProperties().getProperty("api_key");
6969
const response = UrlFetchApp.fetch(
70-
"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=" +
71-
apiKey,
70+
`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${apiKey}`,
7271
options,
7372
);
7473

ai/custom_func_vertex/aiVertex.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ function credentialsForVertexAI() {
105105

106106
const service = OAuth2.createService("Vertex")
107107
.setTokenUrl("https://oauth2.googleapis.com/token")
108-
.setPrivateKey(parsedCredentials["private_key"])
109-
.setIssuer(parsedCredentials["client_email"])
108+
.setPrivateKey(parsedCredentials.private_key)
109+
.setIssuer(parsedCredentials.client_email)
110110
.setPropertyStore(PropertiesService.getScriptProperties())
111111
.setScope("https://www.googleapis.com/auth/cloud-platform");
112112
return {
113-
projectId: parsedCredentials["project_id"],
113+
projectId: parsedCredentials.project_id,
114114
accessToken: service.getAccessToken(),
115115
};
116116
}

ai/devdocs-link-preview/Vertex.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ function credentialsForVertexAI() {
103103
const parsedCredentials = JSON.parse(credentials);
104104
const service = OAuth2.createService("Vertex")
105105
.setTokenUrl("https://oauth2.googleapis.com/token")
106-
.setPrivateKey(parsedCredentials["private_key"])
107-
.setIssuer(parsedCredentials["client_email"])
106+
.setPrivateKey(parsedCredentials.private_key)
107+
.setIssuer(parsedCredentials.client_email)
108108
.setPropertyStore(PropertiesService.getScriptProperties())
109109
.setScope("https://www.googleapis.com/auth/cloud-platform");
110110
return {
111-
projectId: parsedCredentials["project_id"],
111+
projectId: parsedCredentials.project_id,
112112
accessToken: service.getAccessToken(),
113113
};
114114
}

ai/drive-rename/ai.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ function credentialsForVertexAI() {
9999

100100
const service = OAuth2.createService("Vertex")
101101
.setTokenUrl("https://oauth2.googleapis.com/token")
102-
.setPrivateKey(parsedCredentials["private_key"])
103-
.setIssuer(parsedCredentials["client_email"])
102+
.setPrivateKey(parsedCredentials.private_key)
103+
.setIssuer(parsedCredentials.client_email)
104104
.setPropertyStore(PropertiesService.getScriptProperties())
105105
.setScope("https://www.googleapis.com/auth/cloud-platform");
106106
return {
107-
projectId: parsedCredentials["project_id"],
107+
projectId: parsedCredentials.project_id,
108108
accessToken: service.getAccessToken(),
109109
};
110110
}

ai/drive-rename/drive.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ function updateCard(e) {
7777
* @return {string} The body of the Google Document.
7878
*/
7979
function getDocumentBody(id) {
80-
var doc = DocumentApp.openById(id);
81-
var body = doc.getBody();
82-
var text = body.getText();
80+
const doc = DocumentApp.openById(id);
81+
const body = doc.getBody();
82+
const text = body.getText();
8383

8484
return text;
8585
}
@@ -94,10 +94,10 @@ function getDocAPIBody(id) {
9494
// Call DOC API REST endpoint to get the file
9595
const url = `https://docs.googleapis.com/v1/documents/${id}`;
9696

97-
var response = UrlFetchApp.fetch(url, {
97+
const response = UrlFetchApp.fetch(url, {
9898
method: "GET",
9999
headers: {
100-
Authorization: "Bearer " + ScriptApp.getOAuthToken(),
100+
Authorization: `Bearer ${ScriptApp.getOAuthToken()}`,
101101
},
102102
muteHttpExceptions: true,
103103
});

ai/drive-rename/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function buildSelectionPage(e) {
3232
const selected = e.drive.activeCursorItem;
3333

3434
// Check if Google Doc type, respond unsupported if not
35-
if (selected.mimeType != "application/vnd.google-apps.document") {
35+
if (selected.mimeType !== "application/vnd.google-apps.document") {
3636
return {
3737
sections: [
3838
{

0 commit comments

Comments
 (0)