Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Feb 15, 2025
1 parent 4793e81 commit 3ca466a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export async function tryLoadConfig<T>(configPath: string, defaultConfig: T): Pr
* @param {object} options - The configuration options.
* @param {string} options.name - The name of the configuration file.
* @param {string} [options.cwd] - The current working directory.
* @param {string} [options.configDir] - The directory containing configuration files.
* @param {string} [options.generatedDir] - The directory for generated files.
* @param {string} [options.endpoint] - The API endpoint to fetch config from in browser environments.
* @param {string} [options.headers] - The headers to send with the request in browser environments.
* @param {T} options.defaultConfig - The default configuration.
Expand Down Expand Up @@ -171,7 +173,9 @@ export function generateConfigTypes(options: {

// Default to empty array if config dir doesn't exist
const files = existsSync(configDir)
? readdirSync(configDir).map(file => file.replace(/\.(ts|js|mjs|cjs|json)$/, ''))
? readdirSync(configDir)
.map(file => file.replace(/\.(ts|js|mjs|cjs|mts|cts|json)$/, ''))
.sort() // Sort the file names alphabetically
: []

const content = `// Generated by bunfig
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
export interface Config<T> {
name?: string
cwd?: string
generatedDir?: string
configDir?: string
generatedDir?: string
endpoint?: string
headers?: Record<string, string>
defaultConfig: T
Expand Down
2 changes: 1 addition & 1 deletion test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, spyOn } from 'bun:test'
import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
import { dirname, resolve } from 'node:path'
import process from 'node:process'
Expand Down

0 comments on commit 3ca466a

Please sign in to comment.