mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:38:26 +02:00
Fix some lint
This commit is contained in:
@@ -328,7 +328,7 @@ export class PluginInstance {
|
|||||||
payload.values = applyFormInputDefaults(args, payload.values);
|
payload.values = applyFormInputDefaults(args, payload.values);
|
||||||
const resolvedArgs = await applyDynamicFormInput(ctx, args, payload);
|
const resolvedArgs = await applyDynamicFormInput(ctx, args, payload);
|
||||||
const resolvedActions: HttpAuthenticationAction[] = [];
|
const resolvedActions: HttpAuthenticationAction[] = [];
|
||||||
for (const { onSelect, ...action } of actions ?? []) {
|
for (const { onSelect: _onSelect, ...action } of actions ?? []) {
|
||||||
resolvedActions.push(action);
|
resolvedActions.push(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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
|
// biome-ignore lint/suspicious/noExplicitAny: stripping dynamic from union type
|
||||||
const { 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ export function interceptStdout(intercept: (text: string) => string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function interceptor(text: string, fn: (text: string) => string) {
|
function interceptor(text: string, fn: (text: string) => string) {
|
||||||
return fn(text).replace(/\n$/, '') + (fn(text) && /\n$/.test(text) ? '\n' : '');
|
return fn(text).replace(/\n$/, '') + (fn(text) && text.endsWith('\n') ? '\n' : '');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ async function getCodeViaEmbeddedBrowser(
|
|||||||
const authorizationUrlStr = authorizationUrl.toString();
|
const authorizationUrlStr = authorizationUrl.toString();
|
||||||
console.log('[oauth2] Authorizing via embedded browser', authorizationUrlStr);
|
console.log('[oauth2] Authorizing via embedded browser', authorizationUrlStr);
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern
|
// oxlint-disable-next-line no-async-promise-executor -- Required for this pattern
|
||||||
return new Promise<string>(async (resolve, reject) => {
|
return new Promise<string>(async (resolve, reject) => {
|
||||||
let foundCode = false;
|
let foundCode = false;
|
||||||
const { close } = await ctx.window.openUrl({
|
const { close } = await ctx.window.openUrl({
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ async function getTokenViaEmbeddedBrowser(
|
|||||||
const authorizationUrlStr = authorizationUrl.toString();
|
const authorizationUrlStr = authorizationUrl.toString();
|
||||||
console.log('[oauth2] Authorizing via embedded browser (implicit)', authorizationUrlStr);
|
console.log('[oauth2] Authorizing via embedded browser (implicit)', authorizationUrlStr);
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: Required for this pattern
|
// oxlint-disable-next-line no-async-promise-executor -- Required for this pattern
|
||||||
return new Promise<AccessToken>(async (resolve, reject) => {
|
return new Promise<AccessToken>(async (resolve, reject) => {
|
||||||
let foundAccessToken = false;
|
let foundAccessToken = false;
|
||||||
const { close } = await ctx.window.openUrl({
|
const { close } = await ctx.window.openUrl({
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ execSync('cargo install wasm-pack --locked', { stdio: 'inherit' });
|
|||||||
function tryExecSync(cmd) {
|
function tryExecSync(cmd) {
|
||||||
try {
|
try {
|
||||||
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
||||||
} catch (_) {
|
} catch {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ for (const ws of workspacesWithDev) {
|
|||||||
|
|
||||||
// Cleanup function to kill all children
|
// Cleanup function to kill all children
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
for (const { ws, child } of children) {
|
for (const { child } of children) {
|
||||||
if (child.exitCode === null) {
|
if (child.exitCode === null) {
|
||||||
// Process still running
|
// Process still running
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ rmSync(tmpDir, { recursive: true, force: true });
|
|||||||
function tryExecSync(cmd) {
|
function tryExecSync(cmd) {
|
||||||
try {
|
try {
|
||||||
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
||||||
} catch (_) {
|
} catch {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ mkdirSync(dstDir, { recursive: true });
|
|||||||
function tryExecSync(cmd) {
|
function tryExecSync(cmd) {
|
||||||
try {
|
try {
|
||||||
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
|
||||||
} catch (_) {
|
} catch {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -512,16 +512,14 @@ function HttpRequestArg({
|
|||||||
help={arg.description}
|
help={arg.description}
|
||||||
value={value}
|
value={value}
|
||||||
disabled={arg.disabled}
|
disabled={arg.disabled}
|
||||||
options={[
|
options={httpRequests.map((r) => {
|
||||||
...httpRequests.map((r) => {
|
|
||||||
return {
|
return {
|
||||||
label:
|
label:
|
||||||
buildRequestBreadcrumbs(r, folders).join(' / ') +
|
buildRequestBreadcrumbs(r, folders).join(' / ') +
|
||||||
(r.id === activeHttpRequest?.id ? ' (current)' : ''),
|
(r.id === activeHttpRequest?.id ? ' (current)' : ''),
|
||||||
value: r.id,
|
value: r.id,
|
||||||
};
|
};
|
||||||
}),
|
})}
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function AutoScroller<T>({
|
|||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (!autoScroll) return;
|
if (!autoScroll) return;
|
||||||
|
|
||||||
data.length; // Make linter happy. We want to refresh when length changes
|
void data.length; // Trigger refresh when length changes
|
||||||
|
|
||||||
const el = containerRef.current;
|
const el = containerRef.current;
|
||||||
if (el == null) return;
|
if (el == null) return;
|
||||||
|
|||||||
@@ -62,13 +62,13 @@ export function SegmentedControl<T extends string>({
|
|||||||
if (e.key === 'ArrowRight') {
|
if (e.key === 'ArrowRight') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const newIndex = Math.abs((selectedIndex + 1) % options.length);
|
const newIndex = Math.abs((selectedIndex + 1) % options.length);
|
||||||
options[newIndex] && setSelectedValue(options[newIndex].value);
|
if (options[newIndex]) setSelectedValue(options[newIndex].value);
|
||||||
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
|
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
|
||||||
child.focus();
|
child.focus();
|
||||||
} else if (e.key === 'ArrowLeft') {
|
} else if (e.key === 'ArrowLeft') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const newIndex = Math.abs((selectedIndex - 1) % options.length);
|
const newIndex = Math.abs((selectedIndex - 1) % options.length);
|
||||||
options[newIndex] && setSelectedValue(options[newIndex].value);
|
if (options[newIndex]) setSelectedValue(options[newIndex].value);
|
||||||
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
|
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
|
||||||
child.focus();
|
child.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export function PdfViewer({ bodyPath, data }: Props) {
|
|||||||
externalLinkTarget="_blank"
|
externalLinkTarget="_blank"
|
||||||
externalLinkRel="noopener noreferrer"
|
externalLinkRel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
{Array.from(new Array(numPages), (_, index) => (
|
{Array.from({ length: numPages }, (_, index) => (
|
||||||
<Page
|
<Page
|
||||||
className="mb-6 select-all"
|
className="mb-6 select-all"
|
||||||
renderTextLayer
|
renderTextLayer
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { defineConfig } from 'vite-plus';
|
import { defineConfig } from 'vite-plus';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
lint: {
|
||||||
|
ignorePatterns: ['npm/**', 'crates/yaak-templates/pkg/**'],
|
||||||
|
},
|
||||||
test: {
|
test: {
|
||||||
exclude: ['**/node_modules/**', '**/flatpak/**'],
|
exclude: ['**/node_modules/**', '**/flatpak/**'],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user