Skip to content

Commit

Permalink
feat!: remove old-school require
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Feb 7, 2025
1 parent 9f4495a commit dd1bb35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async function loadConfigFile<T>(
if (typeof parser === 'function') {
config = await parser(filepath)
}
else if (parser === 'require' || parser === 'import') {
else if (parser === 'import') {
if (process.features.typescript || process.versions.bun || process.versions.deno) {
const defaultImport = await import(filepath)
config = interopDefault(defaultImport)
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Arrayable, Awaitable } from '@antfu/utils'

export const defaultExtensions = ['mts', 'cts', 'ts', 'mjs', 'cjs', 'js', 'json', '']

export type BuiltinParsers = 'require' | 'json' | 'import'
export type BuiltinParsers = 'json' | 'import'

export type CustomParser<T> = (filepath: string) => Awaitable<T | undefined>

Expand Down

0 comments on commit dd1bb35

Please sign in to comment.