Skip to content

Commit

Permalink
support resolving module config
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Jul 13, 2020
1 parent 276fb6f commit b2eb6f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const getConfigPath = async () => {
const explorer = cosmiconfig('swiftlint');
const result = await explorer.search();
const tmppath = path.resolve(os.tmpdir(), 'swiftlint-config');
await writeJson(tmppath, result.config, { spaces: 2 });
const config = typeof result.config === 'string' ? require(result.config) : result.config;

await writeJson(tmppath, config, { spaces: 2 });
console.log('swiftlint: using config from', result.filepath);

return tmppath;
Expand Down

0 comments on commit b2eb6f7

Please sign in to comment.