diff --git a/src/util/__tests__/formatting.js b/src/util/__tests__/formatting.js index e9e26d5..cf6f644 100644 --- a/src/util/__tests__/formatting.js +++ b/src/util/__tests__/formatting.js @@ -23,13 +23,13 @@ const presentConfigFileExpected = `{ ` test('falls back to JSON.stringify when the configPath cannot resolve to a config', () => { - expect(formatting.formatConfig(absentFile, content)).toBe( + expect(formatting.formatConfig(content, absentFile)).toBe( absentConfigFileExpected, ) }) test('uses Prettier when the configPath can resolve to a config', () => { - expect(formatting.formatConfig(presentFile, content)).toBe( + expect(formatting.formatConfig(content, presentFile)).toBe( presentConfigFileExpected, ) }) diff --git a/src/util/formatting.js b/src/util/formatting.js index eec2119..4e4e0e3 100644 --- a/src/util/formatting.js +++ b/src/util/formatting.js @@ -1,4 +1,4 @@ -function formatConfig(configPath, content) { +function formatConfig(content, configPath) { const stringified = JSON.stringify(content, null, 2) try { const prettier = require('prettier')