mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-11 15:22:54 +02:00
Enable type-aware linting and replace biome-ignore with oxlint-disable
- Enable typeAware option and no-explicit-any (error) in vite.config.ts - Ignore generated binding files from linting - Convert all 96 biome-ignore comments to oxlint-disable equivalents - Add suppression comments for 3 previously uncovered any usages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -88,6 +88,7 @@ export function getAnyModel(
|
|||||||
): AnyModel | null {
|
): AnyModel | null {
|
||||||
let data = mustStore().get(modelStoreDataAtom);
|
let data = mustStore().get(modelStoreDataAtom);
|
||||||
for (const t of Object.keys(data)) {
|
for (const t of Object.keys(data)) {
|
||||||
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let v = (data as any)[t]?.[id];
|
let v = (data as any)[t]?.[id];
|
||||||
if (v?.model === t) return v;
|
if (v?.model === t) return v;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
export function debounce(fn: (...args: any[]) => void, delay = 500) {
|
export function debounce(fn: (...args: any[]) => void, delay = 500) {
|
||||||
let timer: ReturnType<typeof setTimeout>;
|
let timer: ReturnType<typeof setTimeout>;
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
const result = (...args: any[]) => {
|
const result = (...args: any[]) => {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
timer = setTimeout(() => fn(...args), delay);
|
timer = setTimeout(() => fn(...args), delay);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ type AddDynamicMethod<T> = {
|
|||||||
) => MaybePromise<Partial<T> | null | undefined>;
|
) => MaybePromise<Partial<T> | null | undefined>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: distributive conditional type pattern
|
// oxlint-disable-next-line no-explicit-any -- distributive conditional type pattern
|
||||||
type AddDynamic<T> = T extends any
|
type AddDynamic<T> = T extends any
|
||||||
? T extends { inputs?: FormInput[] }
|
? T extends { inputs?: FormInput[] }
|
||||||
? Omit<T, 'inputs'> & {
|
? Omit<T, 'inputs'> & {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ type AddDynamicMethod<T> = {
|
|||||||
) => MaybePromise<Partial<T> | null | undefined>;
|
) => MaybePromise<Partial<T> | null | undefined>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: distributive conditional type pattern
|
// oxlint-disable-next-line no-explicit-any -- distributive conditional type pattern
|
||||||
type AddDynamic<T> = T extends any
|
type AddDynamic<T> = T extends any
|
||||||
? T extends { inputs?: FormInput[] }
|
? T extends { inputs?: FormInput[] }
|
||||||
? Omit<T, 'inputs'> & {
|
? Omit<T, 'inputs'> & {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ type AddDynamicMethod<T> = {
|
|||||||
) => MaybePromise<Partial<T> | null | undefined>;
|
) => MaybePromise<Partial<T> | null | undefined>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: distributive conditional type pattern
|
// oxlint-disable-next-line no-explicit-any -- distributive conditional type pattern
|
||||||
type AddDynamic<T> = T extends any
|
type AddDynamic<T> = T extends any
|
||||||
? T extends { inputs?: FormInput[] }
|
? T extends { inputs?: FormInput[] }
|
||||||
? Omit<T, 'inputs'> & {
|
? Omit<T, 'inputs'> & {
|
||||||
|
|||||||
@@ -910,7 +910,7 @@ export class PluginInstance {
|
|||||||
render: async (args: TemplateRenderRequest) => {
|
render: async (args: TemplateRenderRequest) => {
|
||||||
const payload = { type: 'template_render_request', ...args } as const;
|
const payload = { type: 'template_render_request', ...args } as const;
|
||||||
const result = await this.#sendForReply<TemplateRenderResponse>(context, payload);
|
const result = await this.#sendForReply<TemplateRenderResponse>(context, payload);
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: That's okay
|
// oxlint-disable-next-line no-explicit-any -- That's okay
|
||||||
return result.data as any;
|
return result.data as any;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -973,7 +973,7 @@ export class PluginInstance {
|
|||||||
|
|
||||||
function stripDynamicCallbacks(inputs: { dynamic?: unknown }[]): FormInput[] {
|
function stripDynamicCallbacks(inputs: { dynamic?: unknown }[]): FormInput[] {
|
||||||
return inputs.map((input) => {
|
return inputs.map((input) => {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: stripping dynamic from union type
|
// oxlint-disable-next-line no-explicit-any -- stripping dynamic from union type
|
||||||
const { dynamic: _dynamic, ...rest } = input as any;
|
const { dynamic: _dynamic, ...rest } = input as any;
|
||||||
if ('inputs' in rest && Array.isArray(rest.inputs)) {
|
if ('inputs' in rest && Array.isArray(rest.inputs)) {
|
||||||
rest.inputs = stripDynamicCallbacks(rest.inputs);
|
rest.inputs = stripDynamicCallbacks(rest.inputs);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ describe('auth-ntlm', () => {
|
|||||||
ntlmMock.parseType2Message.mockReset();
|
ntlmMock.parseType2Message.mockReset();
|
||||||
ntlmMock.createType3Message.mockReset();
|
ntlmMock.createType3Message.mockReset();
|
||||||
ntlmMock.createType1Message.mockReturnValue('NTLM TYPE1');
|
ntlmMock.createType1Message.mockReturnValue('NTLM TYPE1');
|
||||||
|
// oxlint-disable-next-line no-explicit-any
|
||||||
ntlmMock.parseType2Message.mockReturnValue({} as any);
|
ntlmMock.parseType2Message.mockReturnValue({} as any);
|
||||||
ntlmMock.createType3Message.mockReturnValue('NTLM TYPE3');
|
ntlmMock.createType3Message.mockReturnValue('NTLM TYPE3');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export async function fetchAccessToken(
|
|||||||
throw new Error(`Failed to fetch access token with status=${resp.status} and body=${body}`);
|
throw new Error(`Failed to fetch access token with status=${resp.status} and body=${body}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let response: any;
|
let response: any;
|
||||||
try {
|
try {
|
||||||
response = JSON.parse(body);
|
response = JSON.parse(body);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export async function getOrRefreshAccessToken(
|
|||||||
throw new Error(`Failed to refresh access token with status=${resp.status} and body=${body}`);
|
throw new Error(`Failed to refresh access token with status=${resp.status} and body=${body}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let response: any;
|
let response: any;
|
||||||
try {
|
try {
|
||||||
response = JSON.parse(body);
|
response = JSON.parse(body);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ function buildClientAssertionJwt(params: {
|
|||||||
signingKey = secret;
|
signingKey = secret;
|
||||||
} else if (trimmed.startsWith('{')) {
|
} else if (trimmed.startsWith('{')) {
|
||||||
// Looks like JSON - treat as JWK. There is surely a better way to detect JWK vs a raw secret, but this should work in most cases.
|
// Looks like JSON - treat as JWK. There is surely a better way to detect JWK vs a raw secret, but this should work in most cases.
|
||||||
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let jwk: any;
|
let jwk: any;
|
||||||
try {
|
try {
|
||||||
jwk = JSON.parse(trimmed);
|
jwk = JSON.parse(trimmed);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const plugin: PluginDefinition = {
|
|||||||
name: 'XPath',
|
name: 'XPath',
|
||||||
description: 'Filter XPath',
|
description: 'Filter XPath',
|
||||||
onFilter(_ctx, args) {
|
onFilter(_ctx, args) {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
const doc: any = new DOMParser().parseFromString(args.payload, 'text/xml');
|
const doc: any = new DOMParser().parseFromString(args.payload, 'text/xml');
|
||||||
try {
|
try {
|
||||||
const result = xpath.select(args.filter, doc, false);
|
const result = xpath.select(args.filter, doc, false);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const plugin: PluginDefinition = {
|
|||||||
name: 'cURL',
|
name: 'cURL',
|
||||||
description: 'Import cURL commands',
|
description: 'Import cURL commands',
|
||||||
onImport(_ctx: Context, args: { text: string }) {
|
onImport(_ctx: Context, args: { text: string }) {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
return convertCurl(args.text) as any;
|
return convertCurl(args.text) as any;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export function deleteUndefinedAttrs<T>(obj: T): T {
|
|||||||
/** Recursively render all nested object properties */
|
/** Recursively render all nested object properties */
|
||||||
export function convertTemplateSyntax<T>(obj: T): T {
|
export function convertTemplateSyntax<T>(obj: T): T {
|
||||||
if (typeof obj === 'string') {
|
if (typeof obj === 'string') {
|
||||||
// biome-ignore lint/suspicious/noTemplateCurlyInString: Yaak template syntax
|
// oxlint-disable-next-line no-template-curly-in-string -- Yaak template syntax
|
||||||
return obj.replaceAll(/{{\s*(_\.)?([^}]+)\s*}}/g, '${[$2]}') as T;
|
return obj.replaceAll(/{{\s*(_\.)?([^}]+)\s*}}/g, '${[$2]}') as T;
|
||||||
}
|
}
|
||||||
if (Array.isArray(obj) && obj != null) {
|
if (Array.isArray(obj) && obj != null) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// biome-ignore-all lint/suspicious/noExplicitAny: too flexible for strict types
|
/* oxlint-disable no-explicit-any */
|
||||||
import type { PartialImportResources } from '@yaakapp/api';
|
import type { PartialImportResources } from '@yaakapp/api';
|
||||||
import { convertId, convertTemplateSyntax, isJSObject } from './common';
|
import { convertId, convertTemplateSyntax, isJSObject } from './common';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// biome-ignore-all lint/suspicious/noExplicitAny: too flexible for strict types
|
/* oxlint-disable no-explicit-any */
|
||||||
import type { PartialImportResources } from '@yaakapp/api';
|
import type { PartialImportResources } from '@yaakapp/api';
|
||||||
import { convertId, convertTemplateSyntax, isJSObject } from './common';
|
import { convertId, convertTemplateSyntax, isJSObject } from './common';
|
||||||
|
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ export const plugin: PluginDefinition = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function convertOpenApi(contents: string): Promise<ImportPluginResponse | undefined> {
|
export async function convertOpenApi(contents: string): Promise<ImportPluginResponse | undefined> {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let postmanCollection: any;
|
let postmanCollection: any;
|
||||||
try {
|
try {
|
||||||
postmanCollection = await new Promise((resolve, reject) => {
|
postmanCollection = await new Promise((resolve, reject) => {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
convert({ type: 'string', data: contents }, {}, (err, result: any) => {
|
convert({ type: 'string', data: contents }, {}, (err, result: any) => {
|
||||||
if (err != null) reject(err);
|
if (err != null) reject(err);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const plugin: PluginDefinition = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function migrateImport(contents: string) {
|
export function migrateImport(contents: string) {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
let parsed: any;
|
let parsed: any;
|
||||||
try {
|
try {
|
||||||
parsed = JSON.parse(contents);
|
parsed = JSON.parse(contents);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export const plugin: PluginDefinition = {
|
|||||||
{
|
{
|
||||||
name: 'token',
|
name: 'token',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
// biome-ignore lint/suspicious/noTemplateCurlyInString: Yaak template syntax
|
// oxlint-disable-next-line no-template-curly-in-string -- Yaak template syntax
|
||||||
defaultValue: '${[1PASSWORD_TOKEN]}',
|
defaultValue: '${[1PASSWORD_TOKEN]}',
|
||||||
dynamic(_ctx, args) {
|
dynamic(_ctx, args) {
|
||||||
switch (args.values.authMethod) {
|
switch (args.values.authMethod) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export const plugin: PluginDefinition = {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
name: 'namespace',
|
name: 'namespace',
|
||||||
label: 'Namespace',
|
label: 'Namespace',
|
||||||
// biome-ignore lint/suspicious/noTemplateCurlyInString: Yaak template syntax
|
// oxlint-disable-next-line no-template-curly-in-string -- Yaak template syntax
|
||||||
defaultValue: '${[ctx.workspace()]}',
|
defaultValue: '${[ctx.workspace()]}',
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export function filterXPath(
|
|||||||
result: XPathResult,
|
result: XPathResult,
|
||||||
join: string | null,
|
join: string | null,
|
||||||
): string {
|
): string {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
const doc: any = new DOMParser().parseFromString(body, 'text/xml');
|
const doc: any = new DOMParser().parseFromString(body, 'text/xml');
|
||||||
const items = xpath.select(path, doc, false);
|
const items = xpath.select(path, doc, false);
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export const syncWorkspace = createFastMutation<
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<TableRow key={i}>
|
<TableRow key={i}>
|
||||||
<TableCell className="text-text-subtle">{model}</TableCell>
|
<TableCell className="text-text-subtle">{model}</TableCell>
|
||||||
<TruncatedWideTableCell>{name}</TruncatedWideTableCell>
|
<TruncatedWideTableCell>{name}</TruncatedWideTableCell>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ function EnvironmentEditDialogSidebar({
|
|||||||
const treeRef = useRef<TreeHandle>(null);
|
const treeRef = useRef<TreeHandle>(null);
|
||||||
const { baseEnvironment, baseEnvironments } = useEnvironmentsBreakdown();
|
const { baseEnvironment, baseEnvironments } = useEnvironmentsBreakdown();
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (selectedEnvironmentId == null) return;
|
if (selectedEnvironmentId == null) return;
|
||||||
treeRef.current?.selectItem(selectedEnvironmentId);
|
treeRef.current?.selectItem(selectedEnvironmentId);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function ExportDataDialogContent({
|
|||||||
|
|
||||||
const handleToggleAll = () => {
|
const handleToggleAll = () => {
|
||||||
setSelectedWorkspaces(
|
setSelectedWorkspaces(
|
||||||
// biome-ignore lint/performance/noAccumulatingSpread: none
|
// oxlint-disable-next-line no-accumulating-spread
|
||||||
allSelected ? {} : workspaces.reduce((acc, w) => ({ ...acc, [w.id]: true }), {}),
|
allSelected ? {} : workspaces.reduce((acc, w) => ({ ...acc, [w.id]: true }), {}),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ function GrpcProtoSelectionDialogWithRequest({ request }: Props & { request: Grp
|
|||||||
{protoFiles.map((f, i) => {
|
{protoFiles.map((f, i) => {
|
||||||
const parts = f.split('/');
|
const parts = f.split('/');
|
||||||
return (
|
return (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<tr key={f + i} className="group">
|
<tr key={f + i} className="group">
|
||||||
<td>
|
<td>
|
||||||
<Icon icon={f.endsWith('.proto') ? 'file_code' : 'folder_code'} />
|
<Icon icon={f.endsWith('.proto') ? 'file_code' : 'folder_code'} />
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export function GrpcResponsePane({ style, methodType, activeRequest }: Props) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Set the active message to the first message received if unary
|
// Set the active message to the first message received if unary
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (events.length === 0 || activeEvent != null || methodType !== 'unary') {
|
if (events.length === 0 || activeEvent != null || methodType !== 'unary') {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function ImportCurlButton() {
|
|||||||
const importCurl = useImportCurl();
|
const importCurl = useImportCurl();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fireAndForget(readText().then(setClipboardText));
|
fireAndForget(readText().then(setClipboardText));
|
||||||
}, [focused]);
|
}, [focused]);
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export function ResponseCookies({ response }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<KeyValueRows>
|
<KeyValueRows>
|
||||||
{sentCookies.map((cookie, i) => (
|
{sentCookies.map((cookie, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<KeyValueRow labelColor="primary" key={i} label={cookie.name}>
|
<KeyValueRow labelColor="primary" key={i} label={cookie.name}>
|
||||||
{cookie.value}
|
{cookie.value}
|
||||||
</KeyValueRow>
|
</KeyValueRow>
|
||||||
@@ -153,7 +153,7 @@ export function ResponseCookies({ response }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
{receivedCookies.map((cookie, i) => (
|
{receivedCookies.map((cookie, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<div key={i} className="flex flex-col gap-1">
|
<div key={i} className="flex flex-col gap-1">
|
||||||
<div className="flex items-center gap-2 my-1">
|
<div className="flex items-center gap-2 my-1">
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export function ResponseHeaders({ response }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<KeyValueRows>
|
<KeyValueRows>
|
||||||
{requestHeaders.map((h, i) => (
|
{requestHeaders.map((h, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<KeyValueRow labelColor="primary" key={i} label={h.name}>
|
<KeyValueRow labelColor="primary" key={i} label={h.name}>
|
||||||
{h.value}
|
{h.value}
|
||||||
</KeyValueRow>
|
</KeyValueRow>
|
||||||
@@ -84,7 +84,7 @@ export function ResponseHeaders({ response }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<KeyValueRows>
|
<KeyValueRows>
|
||||||
{responseHeaders.map((h, i) => (
|
{responseHeaders.map((h, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<KeyValueRow labelColor="info" key={i} label={h.name}>
|
<KeyValueRow labelColor="info" key={i} label={h.name}>
|
||||||
{h.value}
|
{h.value}
|
||||||
</KeyValueRow>
|
</KeyValueRow>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { VStack } from './core/Stacks';
|
|||||||
export default function RouteError({ error }: { error: unknown }) {
|
export default function RouteError({ error }: { error: unknown }) {
|
||||||
console.log('Error', error);
|
console.log('Error', error);
|
||||||
const stringified = JSON.stringify(error);
|
const stringified = JSON.stringify(error);
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
const message = (error as any).message ?? stringified;
|
const message = (error as any).message ?? stringified;
|
||||||
const stack =
|
const stack =
|
||||||
typeof error === 'object' && error != null && 'stack' in error ? String(error.stack) : null;
|
typeof error === 'object' && error != null && 'stack' in error ? String(error.stack) : null;
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export function SettingsCertificates() {
|
|||||||
<VStack space={3}>
|
<VStack space={3}>
|
||||||
{certificates.map((cert, index) => (
|
{certificates.map((cert, index) => (
|
||||||
<CertificateEditor
|
<CertificateEditor
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: Index is fine here
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={index}
|
key={index}
|
||||||
certificate={cert}
|
certificate={cert}
|
||||||
index={index}
|
index={index}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ function InitializedTemplateFunctionDialog({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const tooLarge = rendered.data ? rendered.data.length > 10000 : false;
|
const tooLarge = rendered.data ? rendered.data.length > 10000 : false;
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Only update this on rendered data change to keep secrets hidden on input change
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Only update this on rendered data change to keep secrets hidden on input change
|
||||||
const dataContainsSecrets = useMemo(() => {
|
const dataContainsSecrets = useMemo(() => {
|
||||||
for (const [name, value] of Object.entries(argValues)) {
|
for (const [name, value] of Object.entries(argValues)) {
|
||||||
const arg = templateFunction.data?.args.find((a) => 'name' in a && a.name === name);
|
const arg = templateFunction.data?.args.find((a) => 'name' in a && a.name === name);
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ function HighlightedKey({ keyText, show }: { keyText: string; show: boolean }) {
|
|||||||
keyText.split('').map((c, i) => {
|
keyText.split('').map((c, i) => {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: it's fine
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={i}
|
key={i}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
c.match(/[0-9]/) && 'text-info',
|
c.match(/[0-9]/) && 'text-info',
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function DetailsBanner({
|
|||||||
storageKey,
|
storageKey,
|
||||||
...extraProps
|
...extraProps
|
||||||
}: Props) {
|
}: Props) {
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: We only want to recompute the atom when storageKey changes
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- We only want to recompute the atom when storageKey changes
|
||||||
const openAtom = useMemo(
|
const openAtom = useMemo(
|
||||||
() =>
|
() =>
|
||||||
storageKey
|
storageKey
|
||||||
|
|||||||
@@ -753,7 +753,7 @@ const Menu = forwardRef<Omit<DropdownRef, 'open' | 'isOpen' | 'toggle' | 'items'
|
|||||||
if (item.type === 'separator') {
|
if (item.type === 'separator') {
|
||||||
return (
|
return (
|
||||||
<Separator
|
<Separator
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: Nothing else available
|
// oxlint-disable-next-line react/no-array-index-key -- Nothing else available
|
||||||
key={i}
|
key={i}
|
||||||
className={classNames('my-1.5', item.label ? 'ml-2' : null)}
|
className={classNames('my-1.5', item.label ? 'ml-2' : null)}
|
||||||
>
|
>
|
||||||
@@ -763,8 +763,8 @@ const Menu = forwardRef<Omit<DropdownRef, 'open' | 'isOpen' | 'toggle' | 'items'
|
|||||||
}
|
}
|
||||||
if (item.type === 'content') {
|
if (item.type === 'content') {
|
||||||
return (
|
return (
|
||||||
// biome-ignore lint/a11y/noStaticElementInteractions: Needs to be clickable but want to support nested buttons
|
// oxlint-disable-next-line jsx-a11y/no-static-element-interactions
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: index is fine
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<div key={i} className={classNames('my-1 mx-2 max-w-xs')} onClick={onClose}>
|
<div key={i} className={classNames('my-1 mx-2 max-w-xs')} onClick={onClose}>
|
||||||
{item.label}
|
{item.label}
|
||||||
</div>
|
</div>
|
||||||
@@ -778,7 +778,7 @@ const Menu = forwardRef<Omit<DropdownRef, 'open' | 'isOpen' | 'toggle' | 'items'
|
|||||||
onFocus={handleFocus}
|
onFocus={handleFocus}
|
||||||
onSelect={handleSelect}
|
onSelect={handleSelect}
|
||||||
onHover={handleItemHover}
|
onHover={handleItemHover}
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: It's fine
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={i}
|
key={i}
|
||||||
item={item}
|
item={item}
|
||||||
/>
|
/>
|
||||||
@@ -786,7 +786,7 @@ const Menu = forwardRef<Omit<DropdownRef, 'open' | 'isOpen' | 'toggle' | 'items'
|
|||||||
})}
|
})}
|
||||||
</VStack>
|
</VStack>
|
||||||
{activeSubmenu && (
|
{activeSubmenu && (
|
||||||
// biome-ignore lint/a11y/noStaticElementInteractions: Container div that cancels hover timeout
|
// oxlint-disable-next-line jsx-a11y/no-static-element-interactions -- Container div that cancels hover timeout
|
||||||
<div
|
<div
|
||||||
ref={submenuRef}
|
ref={submenuRef}
|
||||||
onMouseEnter={() => {
|
onMouseEnter={() => {
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ function EditorInner({
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Update the language extension when the language changes
|
// Update the language extension when the language changes
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally limited deps
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- intentionally limited deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cm.current === null) return;
|
if (cm.current === null) return;
|
||||||
const { view, languageCompartment } = cm.current;
|
const { view, languageCompartment } = cm.current;
|
||||||
@@ -361,7 +361,7 @@ function EditorInner({
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Initialize the editor when ref mounts
|
// Initialize the editor when ref mounts
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: only reinitialize when necessary
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- only reinitialize when necessary
|
||||||
const initEditorRef = useCallback(
|
const initEditorRef = useCallback(
|
||||||
function initEditorRef(container: HTMLDivElement | null) {
|
function initEditorRef(container: HTMLDivElement | null) {
|
||||||
if (container === null) {
|
if (container === null) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// biome-ignore-all lint: Disable for generated file
|
/* oxlint-disable */
|
||||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||||
import { LRParser } from '@lezer/lr';
|
import { LRParser } from '@lezer/lr';
|
||||||
import { highlight } from './highlight';
|
import { highlight } from './highlight';
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const tooltip = hoverTooltip(
|
|||||||
let match: RegExpExecArray | null;
|
let match: RegExpExecArray | null;
|
||||||
let found: { start: number; end: number } | null = null;
|
let found: { start: number; end: number } | null = null;
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noAssignInExpressions: none
|
// oxlint-disable-next-line no-cond-assign
|
||||||
while ((match = REGEX.exec(text))) {
|
while ((match = REGEX.exec(text))) {
|
||||||
const start = from + match.index;
|
const start = from + match.index;
|
||||||
const end = start + match[0].length;
|
const end = start + match[0].length;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function jsonParseLinter(options?: JsonLintOptions) {
|
|||||||
mode: (options?.allowComments ?? true) ? 'cjson' : 'json',
|
mode: (options?.allowComments ?? true) ? 'cjson' : 'json',
|
||||||
ignoreTrailingCommas: options?.allowTrailingCommas ?? false,
|
ignoreTrailingCommas: options?.allowTrailingCommas ?? false,
|
||||||
});
|
});
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (!('location' in err)) {
|
if (!('location' in err)) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// biome-ignore-all lint/suspicious/noTemplateCurlyInString: We're testing this, specifically
|
/* oxlint-disable no-template-curly-in-string */
|
||||||
|
|
||||||
import { describe, expect, test } from 'vite-plus/test';
|
import { describe, expect, test } from 'vite-plus/test';
|
||||||
import { parser } from './twig';
|
import { parser } from './twig';
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export function HotkeyRaw({ labelParts, className, variant }: HotkeyRawProps) {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{labelParts.map((char, index) => (
|
{labelParts.map((char, index) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<div key={index} className="min-w-[1em] text-center">
|
<div key={index} className="min-w-[1em] text-center">
|
||||||
{char}
|
{char}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ function BaseInput({
|
|||||||
isFocused: () => editorRef.current?.hasFocus ?? false,
|
isFocused: () => editorRef.current?.hasFocus ?? false,
|
||||||
value: () => editorRef.current?.state.doc.toString() ?? '',
|
value: () => editorRef.current?.state.doc.toString() ?? '',
|
||||||
dispatch: (...args) => {
|
dispatch: (...args) => {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
editorRef.current?.dispatch(...(args as any));
|
editorRef.current?.dispatch(...(args as any));
|
||||||
},
|
},
|
||||||
selectAll() {
|
selectAll() {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Icon } from './Icon';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
depth?: number;
|
depth?: number;
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
attrValue: any;
|
attrValue: any;
|
||||||
attrKey?: string | number;
|
attrKey?: string | number;
|
||||||
attrKeyJsonPath?: string;
|
attrKeyJsonPath?: string;
|
||||||
@@ -54,10 +54,10 @@ export const JsonAttributeTree = ({
|
|||||||
if (jsonType === '[object Array]') {
|
if (jsonType === '[object Array]') {
|
||||||
return {
|
return {
|
||||||
children: isExpanded
|
children: isExpanded
|
||||||
? // biome-ignore lint/suspicious/noExplicitAny: none
|
? // oxlint-disable-next-line no-explicit-any
|
||||||
attrValue.flatMap((v: any, i: number) => (
|
attrValue.flatMap((v: any, i: number) => (
|
||||||
<JsonAttributeTree
|
<JsonAttributeTree
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={i}
|
key={i}
|
||||||
depth={depth + 1}
|
depth={depth + 1}
|
||||||
attrValue={v}
|
attrValue={v}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export function KeyValueRows({ children }: Props) {
|
|||||||
<table className="text-editor font-mono min-w-0 w-full mb-auto">
|
<table className="text-editor font-mono min-w-0 w-full mb-auto">
|
||||||
<tbody className="divide-y divide-surface-highlight">
|
<tbody className="divide-y divide-surface-highlight">
|
||||||
{childArray.map((child, i) => (
|
{childArray.map((child, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<tr key={i}>{child}</tr>
|
<tr key={i}>{child}</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function Label({
|
|||||||
{required === true && <span className="text-text-subtlest">*</span>}
|
{required === true && <span className="text-text-subtlest">*</span>}
|
||||||
</span>
|
</span>
|
||||||
{tags.map((tag, i) => (
|
{tags.map((tag, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<span key={i} className="text-xs text-text-subtlest">
|
<span key={i} className="text-xs text-text-subtlest">
|
||||||
({tag})
|
({tag})
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export function PairEditor({
|
|||||||
[handle, pairs, setRef],
|
[handle, pairs, setRef],
|
||||||
);
|
);
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Only care about forceUpdateKey
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Only care about forceUpdateKey
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Remove empty headers on initial render and ensure they all have valid ids (pairs didn't use to have IDs)
|
// Remove empty headers on initial render and ensure they all have valid ids (pairs didn't use to have IDs)
|
||||||
const newPairs: PairWithId[] = [];
|
const newPairs: PairWithId[] = [];
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
|
|||||||
key={forceUpdateKey}
|
key={forceUpdateKey}
|
||||||
type={type === 'password' && !obscured ? 'text' : type}
|
type={type === 'password' && !obscured ? 'text' : type}
|
||||||
name={name}
|
name={name}
|
||||||
// biome-ignore lint/a11y/noAutofocus: Who cares
|
// oxlint-disable-next-line jsx-a11y/no-autofocus
|
||||||
autoFocus={autoFocus}
|
autoFocus={autoFocus}
|
||||||
defaultValue={defaultValue ?? undefined}
|
defaultValue={defaultValue ?? undefined}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ interface HStackProps extends BaseStackProps {
|
|||||||
|
|
||||||
export const HStack = forwardRef(function HStack(
|
export const HStack = forwardRef(function HStack(
|
||||||
{ className, space, children, alignItems = 'center', ...props }: HStackProps,
|
{ className, space, children, alignItems = 'center', ...props }: HStackProps,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
ref: ForwardedRef<any>,
|
ref: ForwardedRef<any>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
@@ -41,7 +41,7 @@ export type VStackProps = BaseStackProps & {
|
|||||||
|
|
||||||
export const VStack = forwardRef(function VStack(
|
export const VStack = forwardRef(function VStack(
|
||||||
{ className, space, children, ...props }: VStackProps,
|
{ className, space, children, ...props }: VStackProps,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
ref: ForwardedRef<any>,
|
ref: ForwardedRef<any>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
@@ -65,7 +65,7 @@ type BaseStackProps = HTMLAttributes<HTMLElement> & {
|
|||||||
|
|
||||||
const BaseStack = forwardRef(function BaseStack(
|
const BaseStack = forwardRef(function BaseStack(
|
||||||
{ className, alignItems, justifyContent, wrap, children, as, ...props }: BaseStackProps,
|
{ className, alignItems, justifyContent, wrap, children, as, ...props }: BaseStackProps,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
ref: ForwardedRef<any>,
|
ref: ForwardedRef<any>,
|
||||||
) {
|
) {
|
||||||
const Component = as ?? 'div';
|
const Component = as ?? 'div';
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export function Tooltip({ children, className, content, tabIndex, size = 'md' }:
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Portal>
|
</Portal>
|
||||||
{/** biome-ignore lint/a11y/useSemanticElements: Needs to be usable in other buttons */}
|
{/* oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- Needs to be usable in other buttons */}
|
||||||
<span
|
<span
|
||||||
ref={triggerRef}
|
ref={triggerRef}
|
||||||
role="button"
|
role="button"
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function TreeInner<T extends { id: string }>(
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Select the first item on first render
|
// Select the first item on first render
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Only used for initial render
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Only used for initial render
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const ids = jotaiStore.get(selectedIdsFamily(treeId));
|
const ids = jotaiStore.get(selectedIdsFamily(treeId));
|
||||||
const fallback = selectableItems[0];
|
const fallback = selectableItems[0];
|
||||||
@@ -736,7 +736,7 @@ function DropRegionAfterList({
|
|||||||
onContextMenu?: (e: MouseEvent<HTMLDivElement>) => void;
|
onContextMenu?: (e: MouseEvent<HTMLDivElement>) => void;
|
||||||
}) {
|
}) {
|
||||||
const { setNodeRef } = useDroppable({ id });
|
const { setNodeRef } = useDroppable({ id });
|
||||||
// biome-ignore lint/a11y/noStaticElementInteractions: Meh
|
// oxlint-disable-next-line jsx-a11y/no-static-element-interactions
|
||||||
return <div ref={setNodeRef} onContextMenu={onContextMenu} />;
|
return <div ref={setNodeRef} onContextMenu={onContextMenu} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const TreeIndentGuide = memo(function TreeIndentGuide({
|
|||||||
<div className="flex">
|
<div className="flex">
|
||||||
{Array.from({ length: depth }).map((_, i) => (
|
{Array.from({ length: depth }).map((_, i) => (
|
||||||
<div
|
<div
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={i}
|
key={i}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'w-[calc(1rem+0.5px)] border-r border-r-text-subtlest',
|
'w-[calc(1rem+0.5px)] border-r border-r-text-subtlest',
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export function equalSubtree<T extends { id: string }>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < ak.length; i++) {
|
for (let i = 0; i < ak.length; i++) {
|
||||||
// biome-ignore lint/style/noNonNullAssertion: none
|
// oxlint-disable-next-line no-non-null-assertion
|
||||||
if (!equalSubtree(ak[i]!, bk[i]!, getItemKey)) return false;
|
if (!equalSubtree(ak[i]!, bk[i]!, getItemKey)) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ interface Props {
|
|||||||
|
|
||||||
type ExplorerItem =
|
type ExplorerItem =
|
||||||
| { kind: 'type'; type: GraphQLType; from: ExplorerItem }
|
| { kind: 'type'; type: GraphQLType; from: ExplorerItem }
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
| { kind: 'field'; type: GraphQLField<any, any>; from: ExplorerItem }
|
| { kind: 'field'; type: GraphQLField<any, any>; from: ExplorerItem }
|
||||||
| { kind: 'input_field'; type: GraphQLInputField; from: ExplorerItem }
|
| { kind: 'input_field'; type: GraphQLInputField; from: ExplorerItem }
|
||||||
| null;
|
| null;
|
||||||
@@ -182,14 +182,14 @@ function GraphQLExplorerHeader({
|
|||||||
<Icon icon="book_open_text" />
|
<Icon icon="book_open_text" />
|
||||||
{crumbs.map((crumb, i) => {
|
{crumbs.map((crumb, i) => {
|
||||||
return (
|
return (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<Fragment key={i}>
|
<Fragment key={i}>
|
||||||
{i > 0 && <Icon icon="chevron_right" className="text-text-subtlest" />}
|
{i > 0 && <Icon icon="chevron_right" className="text-text-subtlest" />}
|
||||||
{crumb === item || item == null ? (
|
{crumb === item || item == null ? (
|
||||||
<GqlTypeLabel noTruncate item={item} />
|
<GqlTypeLabel noTruncate item={item} />
|
||||||
) : crumb === item ? null : (
|
) : crumb === item ? null : (
|
||||||
<GqlTypeLink
|
<GqlTypeLink
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
key={i}
|
key={i}
|
||||||
noTruncate
|
noTruncate
|
||||||
item={crumb}
|
item={crumb}
|
||||||
@@ -674,7 +674,7 @@ function Subheading({ children, count }: { children: ReactNode; count?: number }
|
|||||||
|
|
||||||
interface SearchResult {
|
interface SearchResult {
|
||||||
name: string;
|
name: string;
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
type: GraphQLNamedType | GraphQLField<any, any> | GraphQLInputField;
|
type: GraphQLNamedType | GraphQLField<any, any> | GraphQLInputField;
|
||||||
score: number;
|
score: number;
|
||||||
from: GraphQLNamedType | null;
|
from: GraphQLNamedType | null;
|
||||||
@@ -897,10 +897,10 @@ function DocMarkdown({ children, className }: { children: string | null; classNa
|
|||||||
|
|
||||||
function walkTypeGraph(
|
function walkTypeGraph(
|
||||||
schema: GraphQLSchema,
|
schema: GraphQLSchema,
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
start: GraphQLType | GraphQLField<any, any> | GraphQLInputField | null,
|
start: GraphQLType | GraphQLField<any, any> | GraphQLInputField | null,
|
||||||
cb: (
|
cb: (
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
type: GraphQLNamedType | GraphQLField<any, any> | GraphQLInputField,
|
type: GraphQLNamedType | GraphQLField<any, any> | GraphQLInputField,
|
||||||
from: GraphQLNamedType | null,
|
from: GraphQLNamedType | null,
|
||||||
path: string[],
|
path: string[],
|
||||||
@@ -908,7 +908,7 @@ function walkTypeGraph(
|
|||||||
) {
|
) {
|
||||||
const visited = new Set<string>();
|
const visited = new Set<string>();
|
||||||
const queue: Array<{
|
const queue: Array<{
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
current: GraphQLType | GraphQLField<any, any> | GraphQLInputField;
|
current: GraphQLType | GraphQLField<any, any> | GraphQLInputField;
|
||||||
from: GraphQLNamedType | null;
|
from: GraphQLNamedType | null;
|
||||||
path: string[];
|
path: string[];
|
||||||
@@ -928,7 +928,7 @@ function walkTypeGraph(
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (queue.length > 0) {
|
while (queue.length > 0) {
|
||||||
// biome-ignore lint/style/noNonNullAssertion: none
|
// oxlint-disable-next-line no-non-null-assertion
|
||||||
const { current, from, path } = queue.shift()!;
|
const { current, from, path } = queue.shift()!;
|
||||||
if (!isNamedType(current)) continue;
|
if (!isNamedType(current)) continue;
|
||||||
|
|
||||||
@@ -981,7 +981,7 @@ function walkTypeGraph(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
function toExplorerItem(t: any, from: ExplorerItem | null): ExplorerItem | null {
|
function toExplorerItem(t: any, from: ExplorerItem | null): ExplorerItem | null {
|
||||||
if (t == null) return null;
|
if (t == null) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ export function AudioViewer({ bodyPath, data }: Props) {
|
|||||||
}
|
}
|
||||||
}, [bodyPath, data]);
|
}, [bodyPath, data]);
|
||||||
|
|
||||||
// biome-ignore lint/a11y/useMediaCaption: none
|
// oxlint-disable-next-line jsx-a11y/media-has-caption
|
||||||
return <audio className="w-full" controls src={src} />;
|
return <audio className="w-full" controls src={src} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export function CsvViewerInner({ text, className }: { text: string | null; class
|
|||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{parsed.data.map((row, i) => (
|
{parsed.data.map((row, i) => (
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
// oxlint-disable-next-line react/no-array-index-key
|
||||||
<TableRow key={i}>
|
<TableRow key={i}>
|
||||||
{parsed.meta.fields?.map((key) => (
|
{parsed.meta.fields?.map((key) => (
|
||||||
<TableCell key={key}>{row[key] ?? ''}</TableCell>
|
<TableCell key={key}>{row[key] ?? ''}</TableCell>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function MultipartViewer({ data, boundary, idPrefix = 'multipart' }: Prop
|
|||||||
>
|
>
|
||||||
{parts.map((part, i) => (
|
{parts.map((part, i) => (
|
||||||
<TabContent
|
<TabContent
|
||||||
// biome-ignore lint/suspicious/noArrayIndexKey: Nothing else to key on
|
// oxlint-disable-next-line react/no-array-index-key -- Nothing else to key on
|
||||||
key={idPrefix + part.name + i}
|
key={idPrefix + part.name + i}
|
||||||
value={tabValue(part, i)}
|
value={tabValue(part, i)}
|
||||||
className="pl-3 !pt-0"
|
className="pl-3 !pt-0"
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ export function VideoViewer({ bodyPath, data }: Props) {
|
|||||||
}
|
}
|
||||||
}, [bodyPath, data]);
|
}, [bodyPath, data]);
|
||||||
|
|
||||||
// biome-ignore lint/a11y/useMediaCaption: none
|
// oxlint-disable-next-line jsx-a11y/media-has-caption
|
||||||
return <video className="w-full" controls src={src} />;
|
return <video className="w-full" controls src={src} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function useEnsureActiveCookieJar() {
|
|||||||
// things change when switching workspaces, and we don't currently have a good way to ensure that all
|
// things change when switching workspaces, and we don't currently have a good way to ensure that all
|
||||||
// stores have updated.
|
// stores have updated.
|
||||||
// TODO: Create a global data store that can handle this case
|
// TODO: Create a global data store that can handle this case
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cookieJars == null) return; // Hasn't loaded yet
|
if (cookieJars == null) return; // Hasn't loaded yet
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,6 @@ export function useFastMutation<TData = unknown, TError = unknown, TVariables =
|
|||||||
) {
|
) {
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
return createFastMutation(defaultArgs);
|
return createFastMutation(defaultArgs);
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Force it!
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Force it!
|
||||||
}, defaultArgs.mutationKey);
|
}, defaultArgs.mutationKey);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function useFolderActions() {
|
|||||||
queryFn: () => getFolderActions(),
|
queryFn: () => getFolderActions(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const actions = useMemo(() => {
|
const actions = useMemo(() => {
|
||||||
return actionsResult.data ?? [];
|
return actionsResult.data ?? [];
|
||||||
}, [JSON.stringify(actionsResult.data)]);
|
}, [JSON.stringify(actionsResult.data)]);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function useGrpcRequestActions() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const actions = useMemo(() => {
|
const actions = useMemo(() => {
|
||||||
return actionsResult.data ?? [];
|
return actionsResult.data ?? [];
|
||||||
}, [JSON.stringify(actionsResult.data)]);
|
}, [JSON.stringify(actionsResult.data)]);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function useHttpRequestActions() {
|
|||||||
queryFn: () => getHttpRequestActions(),
|
queryFn: () => getHttpRequestActions(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const actions = useMemo(() => {
|
const actions = useMemo(() => {
|
||||||
return actionsResult.data ?? [];
|
return actionsResult.data ?? [];
|
||||||
}, [JSON.stringify(actionsResult.data)]);
|
}, [JSON.stringify(actionsResult.data)]);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export function useIntrospectGraphQL(
|
|||||||
}
|
}
|
||||||
}, [activeEnvironment?.id, baseRequest, upsertIntrospection]);
|
}, [activeEnvironment?.id, baseRequest, upsertIntrospection]);
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Skip introspection if automatic is disabled and we already have one
|
// Skip introspection if automatic is disabled and we already have one
|
||||||
if (options.disabled) {
|
if (options.disabled) {
|
||||||
@@ -144,14 +144,14 @@ function tryParseIntrospectionToSchema(
|
|||||||
let parsedResponse: IntrospectionQuery;
|
let parsedResponse: IntrospectionQuery;
|
||||||
try {
|
try {
|
||||||
parsedResponse = JSON.parse(content).data;
|
parsedResponse = JSON.parse(content).data;
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
return { error: String('message' in e ? e.message : e) };
|
return { error: String('message' in e ? e.message : e) };
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return { schema: buildClientSchema(parsedResponse, {}) };
|
return { schema: buildClientSchema(parsedResponse, {}) };
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
return { error: String('message' in e ? e.message : e) };
|
return { error: String('message' in e ? e.message : e) };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function useKeyValue<T extends object | boolean | number | string | null>
|
|||||||
fallback: T;
|
fallback: T;
|
||||||
}) {
|
}) {
|
||||||
const { value, isLoading } = useAtomValue(
|
const { value, isLoading } = useAtomValue(
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Only create a new atom when the key changes. Fallback might not be a stable reference, so we don't want to refresh on that.
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Only create a new atom when the key changes. Fallback might not be a stable reference, so we don't want to refresh on that.
|
||||||
useMemo(
|
useMemo(
|
||||||
() =>
|
() =>
|
||||||
selectAtom(
|
selectAtom(
|
||||||
@@ -42,7 +42,7 @@ export function useKeyValue<T extends object | boolean | number | string | null>
|
|||||||
mutationFn: (value) => setKeyValue<T>({ namespace, key, value }),
|
mutationFn: (value) => setKeyValue<T>({ namespace, key, value }),
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const set = useCallback(
|
const set = useCallback(
|
||||||
async (valueOrUpdate: ((v: T) => T) | T) => {
|
async (valueOrUpdate: ((v: T) => T) | T) => {
|
||||||
if (typeof valueOrUpdate === 'function') {
|
if (typeof valueOrUpdate === 'function') {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export function useKeyboardEvent(
|
|||||||
key: KeyboardEvent['key'],
|
key: KeyboardEvent['key'],
|
||||||
cb: () => void,
|
cb: () => void,
|
||||||
) {
|
) {
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Don't have `cb` as a dep for caller convenience
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- Don't have `cb` as a dep for caller convenience
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fn = (e: KeyboardEvent) => {
|
const fn = (e: KeyboardEvent) => {
|
||||||
if (e.key === key) cb();
|
if (e.key === key) cb();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export function useRequestEditorEvent<
|
|||||||
return () => {
|
return () => {
|
||||||
emitter.off(event, fn);
|
emitter.off(event, fn);
|
||||||
};
|
};
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: We're handing deps manually
|
// oxlint-disable-next-line react-hooks/exhaustive-deps -- We're handing deps manually
|
||||||
}, deps);
|
}, deps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useEffect, useState } from 'react';
|
|||||||
*/
|
*/
|
||||||
export function useStateWithDeps<T>(defaultValue: T | (() => T), deps: DependencyList) {
|
export function useStateWithDeps<T>(defaultValue: T | (() => T), deps: DependencyList) {
|
||||||
const [value, setValue] = useState(defaultValue);
|
const [value, setValue] = useState(defaultValue);
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setValue(defaultValue);
|
setValue(defaultValue);
|
||||||
}, [...deps]);
|
}, [...deps]);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function useWebsocketRequestActions() {
|
|||||||
queryFn: () => getWebsocketRequestActions(),
|
queryFn: () => getWebsocketRequestActions(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const actions = useMemo(() => {
|
const actions = useMemo(() => {
|
||||||
return actionsResult.data ?? [];
|
return actionsResult.data ?? [];
|
||||||
}, [JSON.stringify(actionsResult.data)]);
|
}, [JSON.stringify(actionsResult.data)]);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function useWorkspaceActions() {
|
|||||||
queryFn: () => getWorkspaceActions(),
|
queryFn: () => getWorkspaceActions(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// biome-ignore lint/correctness/useExhaustiveDependencies: none
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const actions = useMemo(() => {
|
const actions = useMemo(() => {
|
||||||
return actionsResult.data ?? [];
|
return actionsResult.data ?? [];
|
||||||
}, [JSON.stringify(actionsResult.data)]);
|
}, [JSON.stringify(actionsResult.data)]);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export function getNodeText(node: ReactNode): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof node === 'object' && node) {
|
if (typeof node === 'object' && node) {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
return getNodeText((node as any).props.children);
|
return getNodeText((node as any).props.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ export function setWorkspaceSearchParams(
|
|||||||
folder_id: string | null;
|
folder_id: string | null;
|
||||||
}>,
|
}>,
|
||||||
) {
|
) {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
(router as any)
|
(router as any)
|
||||||
.navigate({
|
.navigate({
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
// oxlint-disable-next-line no-explicit-any
|
||||||
search: (prev: any) => {
|
search: (prev: any) => {
|
||||||
// console.log('Navigating to', { prev, search });
|
// console.log('Navigating to', { prev, search });
|
||||||
const o = { ...prev, ...search };
|
const o = { ...prev, ...search };
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ export function getThemeCSS(theme: Theme): string {
|
|||||||
theme.components.toast = theme.components.toast ?? theme.components.menu ?? {};
|
theme.components.toast = theme.components.toast ?? theme.components.menu ?? {};
|
||||||
const { components, id, label } = theme;
|
const { components, id, label } = theme;
|
||||||
const colors = Object.keys(theme.base).reduce((prev, key) => {
|
const colors = Object.keys(theme.base).reduce((prev, key) => {
|
||||||
// biome-ignore lint/performance/noAccumulatingSpread: none
|
// oxlint-disable-next-line no-accumulating-spread
|
||||||
return { ...prev, [key]: theme.base[key as YaakColorKey] };
|
return { ...prev, [key]: theme.base[key as YaakColorKey] };
|
||||||
}, {}) as ThemeComponentColors;
|
}, {}) as ThemeComponentColors;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type WorkspaceSearchSchema = {
|
|||||||
| {
|
| {
|
||||||
folder_id: string;
|
folder_id: string;
|
||||||
}
|
}
|
||||||
// biome-ignore lint/complexity/noBannedTypes: Needed to support empty
|
// oxlint-disable-next-line no-restricted-types -- Needed to support empty
|
||||||
| {}
|
| {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -2,7 +2,13 @@ import { defineConfig } from 'vite-plus';
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
lint: {
|
lint: {
|
||||||
ignorePatterns: ['npm/**', 'crates/yaak-templates/pkg/**'],
|
ignorePatterns: ['npm/**', 'crates/yaak-templates/pkg/**', '**/bindings/gen_*.ts'],
|
||||||
|
options: {
|
||||||
|
typeAware: true,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'typescript/no-explicit-any': 'error',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
test: {
|
test: {
|
||||||
exclude: ['**/node_modules/**', '**/flatpak/**'],
|
exclude: ['**/node_modules/**', '**/flatpak/**'],
|
||||||
|
|||||||
Reference in New Issue
Block a user