mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-05 08:47:05 +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:
@@ -17,6 +17,7 @@ describe('auth-ntlm', () => {
|
||||
ntlmMock.parseType2Message.mockReset();
|
||||
ntlmMock.createType3Message.mockReset();
|
||||
ntlmMock.createType1Message.mockReturnValue('NTLM TYPE1');
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
ntlmMock.parseType2Message.mockReturnValue({} as any);
|
||||
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}`);
|
||||
}
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
let response: any;
|
||||
try {
|
||||
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}`);
|
||||
}
|
||||
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
let response: any;
|
||||
try {
|
||||
response = JSON.parse(body);
|
||||
|
||||
@@ -53,6 +53,7 @@ function buildClientAssertionJwt(params: {
|
||||
signingKey = secret;
|
||||
} 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.
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
let jwk: any;
|
||||
try {
|
||||
jwk = JSON.parse(trimmed);
|
||||
|
||||
@@ -8,7 +8,7 @@ export const plugin: PluginDefinition = {
|
||||
name: 'XPath',
|
||||
description: 'Filter XPath',
|
||||
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');
|
||||
try {
|
||||
const result = xpath.select(args.filter, doc, false);
|
||||
|
||||
@@ -48,7 +48,7 @@ export const plugin: PluginDefinition = {
|
||||
name: 'cURL',
|
||||
description: 'Import cURL commands',
|
||||
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;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export function deleteUndefinedAttrs<T>(obj: T): T {
|
||||
/** Recursively render all nested object properties */
|
||||
export function convertTemplateSyntax<T>(obj: T): T {
|
||||
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;
|
||||
}
|
||||
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 { 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 { convertId, convertTemplateSyntax, isJSObject } from './common';
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ export const plugin: PluginDefinition = {
|
||||
};
|
||||
|
||||
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;
|
||||
try {
|
||||
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) => {
|
||||
if (err != null) reject(err);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export const plugin: PluginDefinition = {
|
||||
};
|
||||
|
||||
export function migrateImport(contents: string) {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
let parsed: any;
|
||||
try {
|
||||
parsed = JSON.parse(contents);
|
||||
|
||||
@@ -123,7 +123,7 @@ export const plugin: PluginDefinition = {
|
||||
{
|
||||
name: 'token',
|
||||
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]}',
|
||||
dynamic(_ctx, args) {
|
||||
switch (args.values.authMethod) {
|
||||
|
||||
@@ -53,7 +53,7 @@ export const plugin: PluginDefinition = {
|
||||
type: 'text',
|
||||
name: '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()]}',
|
||||
optional: true,
|
||||
},
|
||||
|
||||
@@ -69,7 +69,7 @@ export function filterXPath(
|
||||
result: XPathResult,
|
||||
join: string | null,
|
||||
): string {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
const doc: any = new DOMParser().parseFromString(body, 'text/xml');
|
||||
const items = xpath.select(path, doc, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user