Skip to content

Commit f30a2e6

Browse files
authored
fix(js): linter errors about typed imports in the editor (#2999)
1 parent 2c33aa4 commit f30a2e6

File tree

302 files changed

+1424
-1411
lines changed

Some content is hidden

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

302 files changed

+1424
-1411
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"javascript": {
4848
"formatter": {
49-
"arrowParentheses": "asNeeded",
49+
"arrowParentheses": "always",
5050
"attributePosition": "auto",
5151
"bracketSpacing": true,
5252
"jsxQuoteStyle": "double",

captainhook.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
{
2828
"run": "CaptainHook::File.BlockSecrets",
2929
"options": {
30-
"presets": ["Aws", "GitHub", "Stripe", "Google"]
30+
"presets": ["Aws", "GitHub", "Stripe", "Google"],
31+
"allowed": ["AIDAQEAAAAAAAAAAAABE"]
3132
}
3233
},
3334
{

genkit-tools/cli/src/commands/eval-extract-data.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import {
17+
import type {
1818
EvalInput,
1919
EvalInputDataset,
2020
TraceData,
@@ -51,14 +51,14 @@ export const evalExtractData = new Command('eval:extractData')
5151
logger.info(`Extracting trace data '/flow/${flowName}'...`);
5252
let dataset: EvalInputDataset = [];
5353
let continuationToken = undefined;
54-
while (dataset.length < parseInt(options.maxRows)) {
54+
while (dataset.length < Number.parseInt(options.maxRows)) {
5555
const response = await manager.listTraces({
56-
limit: parseInt(options.maxRows),
56+
limit: Number.parseInt(options.maxRows),
5757
continuationToken,
5858
});
5959
continuationToken = response.continuationToken;
6060
const traces = response.traces;
61-
let batch: EvalInput[] = traces
61+
const batch: EvalInput[] = traces
6262
.map((t) => {
6363
const rootSpan = Object.values(t.spans).find(
6464
(s) =>
@@ -88,8 +88,8 @@ export const evalExtractData = new Command('eval:extractData')
8888
})
8989
.filter((result): result is EvalInput => !!result);
9090
batch.forEach((d) => dataset.push(d));
91-
if (dataset.length > parseInt(options.maxRows)) {
92-
dataset = dataset.splice(0, parseInt(options.maxRows));
91+
if (dataset.length > Number.parseInt(options.maxRows)) {
92+
dataset = dataset.splice(0, Number.parseInt(options.maxRows));
9393
break;
9494
}
9595
if (!continuationToken) {

genkit-tools/cli/src/commands/eval-flow.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
*/
1616

1717
import {
18-
Action,
19-
Dataset,
20-
DatasetMetadata,
2118
DatasetSchema,
19+
type Action,
20+
type Dataset,
21+
type DatasetMetadata,
2222
} from '@genkit-ai/tools-common';
2323
import {
24-
EvalExporter,
2524
getAllEvaluatorActions,
2625
getDatasetStore,
2726
getExporterForString,
2827
getMatchingEvaluatorActions,
2928
runEvaluation,
3029
runInference,
30+
type EvalExporter,
3131
} from '@genkit-ai/tools-common/eval';
3232
import {
3333
confirmLlmUse,
@@ -85,7 +85,7 @@ export const evalFlow = new Command('eval:flow')
8585
.option(
8686
'--batchSize <batchSize>',
8787
'batch size to use for parallel evals (default to 1, no parallelization)',
88-
parseInt
88+
Number.parseInt
8989
)
9090
.option('-f, --force', 'Automatically accept all interactive prompts')
9191
.action(

genkit-tools/cli/src/commands/eval-run.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Action, EvalInputDataset } from '@genkit-ai/tools-common';
17+
import type { Action, EvalInputDataset } from '@genkit-ai/tools-common';
1818
import {
19-
EvalExporter,
2019
getAllEvaluatorActions,
2120
getExporterForString,
2221
getMatchingEvaluatorActions,
2322
runEvaluation,
23+
type EvalExporter,
2424
} from '@genkit-ai/tools-common/eval';
2525
import {
2626
confirmLlmUse,
@@ -62,7 +62,7 @@ export const evalRun = new Command('eval:run')
6262
.option(
6363
'--batchSize <batchSize>',
6464
'batch size to use for parallel evals (default to 1, no parallelization)',
65-
parseInt
65+
Number.parseInt
6666
)
6767
.option('--force', 'Automatically accept all interactive prompts')
6868
.action(async (dataset: string, options: EvalRunCliOptions) => {

genkit-tools/cli/src/commands/flow-batch-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const flowBatchRun = new Command('flow:batchRun')
5757
const outputValues = [] as { input: any; output: any }[];
5858
for (const data of input) {
5959
logger.info(`Running '/flow/${flowName}'...`);
60-
let response = await manager.runAction({
60+
const response = await manager.runAction({
6161
key: `/flow/${flowName}`,
6262
input: data,
6363
context: options.context ? JSON.parse(options.context) : undefined,

genkit-tools/cli/src/commands/flow-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const flowRun = new Command('flow:run')
4141
.action(async (flowName: string, data: string, options: FlowRunOptions) => {
4242
await runWithManager(async (manager) => {
4343
logger.info(`Running '/flow/${flowName}' (stream=${options.stream})...`);
44-
let result = (
44+
const result = (
4545
await manager.runAction(
4646
{
4747
key: `/flow/${flowName}`,

genkit-tools/cli/src/commands/plugins.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*/
1616

1717
import {
18-
BaseToolPluginAction,
19-
SpecialAction,
20-
SupportedFlagValues,
21-
ToolPlugin,
2218
findToolsConfig,
19+
type BaseToolPluginAction,
20+
type SpecialAction,
21+
type SupportedFlagValues,
22+
type ToolPlugin,
2323
} from '@genkit-ai/tools-common/plugin';
2424
import { logger } from '@genkit-ai/tools-common/utils';
2525
import * as clc from 'colorette';

genkit-tools/cli/src/commands/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { RuntimeManager } from '@genkit-ai/tools-common/manager';
17+
import type { RuntimeManager } from '@genkit-ai/tools-common/manager';
1818
import { startServer } from '@genkit-ai/tools-common/server';
1919
import { logger } from '@genkit-ai/tools-common/utils';
2020
import { spawn } from 'child_process';

genkit-tools/cli/src/commands/ui-start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616

1717
import {
18-
DevToolsInfo,
1918
findServersDir,
2019
isValidDevToolsInfo,
2120
logger,
2221
waitUntilHealthy,
22+
type DevToolsInfo,
2323
} from '@genkit-ai/tools-common/utils';
2424
import axios from 'axios';
25-
import { ChildProcess, spawn } from 'child_process';
25+
import { spawn, type ChildProcess } from 'child_process';
2626
import * as clc from 'colorette';
2727
import { Command } from 'commander';
2828
import fs from 'fs/promises';

0 commit comments

Comments
 (0)