Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions apps/oxlint/src-js/js_config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { basename as pathBasename } from "node:path";

import { getErrorMessage } from "./utils/utils.ts";
import { isDefineConfig } from "./package/config.ts";
import { DateNow, JSONStringify } from "./utils/globals.ts";

interface JsConfigResult {
Expand Down Expand Up @@ -135,12 +134,6 @@ export async function loadJsConfigs(paths: string[]): Promise<string> {
if (!isObject(config)) {
throw new Error(`Configuration file must have a default export that is an object.`);
}

if (!isDefineConfig(config)) {
throw new Error(
`Configuration file must wrap its default export with defineConfig() from "oxlint".`,
);
}
validateConfigExtends(config as object);
return { path, config };
}),
Expand Down
9 changes: 0 additions & 9 deletions apps/oxlint/src-js/package/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,12 @@ export interface OxlintConfig extends Oxlintrc {

export type { OxlintOverride };

const DEFINE_CONFIG_REGISTRY = new WeakSet<object>();

/**
* Define an Oxlint configuration with type inference.
*
* @param config - Oxlint configuration
* @returns Config unchanged
*/
export function defineConfig<T extends OxlintConfig>(config: T): T {
DEFINE_CONFIG_REGISTRY.add(config as object);
return config;
}

export function isDefineConfig(config: unknown): boolean {
return (
typeof config === "object" && config !== null && DEFINE_CONFIG_REGISTRY.has(config as object)
);
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading