Skip to content

Commit

Permalink
Got tired of it
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 9, 2024
1 parent 4a3f84c commit 2f2a11e
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 13 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"useNodeAssertStrict": "error"
},
"suspicious": {
"noConsoleLog": "error"
"noConsoleLog": "error",
"noExplicitAny": "off"
}
}
},
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/remark/transformDirectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { type Visitor, visit } from 'unist-util-visit';
interface DirectiveNode extends Node {
type: 'textDirective' | 'leafDirective' | 'containerDirective';
name: string;
// biome-ignore lint/suspicious/noExplicitAny: ignore
attributes: Record<string, any>;
// biome-ignore lint/suspicious/noExplicitAny: ignore
data: Record<string, any>;
}

Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/CacheConsultant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { timerify } from './util/Performance.js';
import { type FileDescriptor, FileEntryCache } from './util/file-entry-cache.js';
import { version } from './version.js';

// biome-ignore lint/suspicious/noExplicitAny: deal with it
const dummyFileDescriptor: FileDescriptor<any> = { key: '', changed: true, notFound: true };

type CacheOptions = {
Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/ConfigurationChief.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export class ConfigurationChief {

resolvedConfigFilePath?: string;

// biome-ignore lint/suspicious/noExplicitAny: raw incoming user data
rawConfig?: any;

constructor({ cwd, isProduction, isStrict, isIncludeEntryExports, workspace }: ConfigurationManagerOptions) {
Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/plugins/nuxt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const isEnabled: IsPluginEnabled = ({ dependencies }) => {
const isEnabled = hasDependency(dependencies, enablers);

// TODO Add generic way for plugins to init?
// biome-ignore lint/suspicious/noExplicitAny: deal with it
if (isEnabled && !('defineNuxtConfig' in globalThis)) (globalThis as any).defineNuxtConfig = (c: any) => c;

return isEnabled;
Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/plugins/playwright/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type ReporterDescription = Readonly<
]
| ['null']
| [string]
// biome-ignore lint/suspicious/noExplicitAny: deal with it
| [string, any]
>;

Expand Down
2 changes: 0 additions & 2 deletions packages/knip/src/types/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ export interface PluginOptions extends BaseOptions {
enabledPlugins: string[];
}

// biome-ignore lint/suspicious/noExplicitAny: TODO
export type ResolveEntryPaths<T = any> = (config: T, options: PluginOptions) => Promise<string[]> | string[];

// biome-ignore lint/suspicious/noExplicitAny: TODO
export type ResolveConfig<T = any> = (config: T, options: PluginOptions) => Promise<string[]> | string[];

export type Resolve = (options: PluginOptions) => Promise<string[]> | string[];
Expand Down
1 change: 0 additions & 1 deletion packages/knip/src/util/Performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { debugLog } from './debug.js';

const { performance: isEnabled = false } = parsedArgValues;

// biome-ignore lint/suspicious/noExplicitAny: ignore
export const timerify = <T extends (...params: any[]) => any>(fn: T, name: string = fn.name): T => {
if (!isEnabled) return fn;
return performance.timerify(Object.defineProperty(fn, 'name', { get: () => name }));
Expand Down
3 changes: 0 additions & 3 deletions packages/knip/src/util/object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// biome-ignore lint/suspicious/noExplicitAny: TODO
export const getValuesByKeyDeep = (obj: any, key: string): unknown[] => {
const objects = [];
if (obj && typeof obj === 'object') {
Expand All @@ -14,7 +13,6 @@ export const getValuesByKeyDeep = (obj: any, key: string): unknown[] => {
return objects;
};

// biome-ignore lint/suspicious/noExplicitAny: TODO
export const getStringValues = (obj: any): string[] => {
if (typeof obj === 'string') return [obj];
let values: string[] = [];
Expand All @@ -38,5 +36,4 @@ export const getKeysByValue = <T>(obj: T, value: unknown): (keyof T)[] => {
return keys;
};

// biome-ignore lint/suspicious/noExplicitAny: TODO
export const get = <T>(obj: T, path: string) => path.split('.').reduce((o: any, p) => o?.[p], obj);

0 comments on commit 2f2a11e

Please sign in to comment.