Skip to content

Commit

Permalink
Rename config arg for consistency with other plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlj95 committed Dec 12, 2024
1 parent 5c9090a commit deda857
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/knip/src/plugins/karma/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const entry: string[] = [];

type ConfigFile = (config: Config) => void;

const resolveConfig: ResolveConfig<ConfigFile> = async (configFile, options) => {
const resolveConfig: ResolveConfig<ConfigFile> = async (localConfig, options) => {
const inputs = new Set<Input>();

const config = loadConfigFromFile(configFile);
const config = loadConfig(localConfig);

if (config.frameworks) {
for (const framework of config.frameworks) {
Expand Down Expand Up @@ -52,10 +52,10 @@ const resolveConfig: ResolveConfig<ConfigFile> = async (configFile, options) =>

const devDepForFramework = (framework: string): string => (framework === 'jasmine' ? 'jasmine-core' : framework);

const resolveEntryPaths: ResolveEntryPaths<ConfigFile> = (configFile, options) => {
const resolveEntryPaths: ResolveEntryPaths<ConfigFile> = (localConfig, options) => {
const inputs = new Set<Input>();

const config = loadConfigFromFile(configFile);
const config = loadConfig(localConfig);

const basePath = config.basePath ?? '';
if (config.files) {
Expand All @@ -73,7 +73,7 @@ const resolveEntryPaths: ResolveEntryPaths<ConfigFile> = (configFile, options) =
return Array.from(inputs);
};

const loadConfigFromFile = (configFile: ConfigFile): ConfigOptions => {
const loadConfig = (configFile: ConfigFile): ConfigOptions => {
const inMemoryConfig = new InMemoryConfig();
configFile(inMemoryConfig);
return inMemoryConfig.config ?? {};
Expand Down

0 comments on commit deda857

Please sign in to comment.