diff --git a/lib/index.js b/lib/index.cjs similarity index 100% rename from lib/index.js rename to lib/index.cjs diff --git a/lib/index.test.js b/lib/index.test.js index 1128489..65b3010 100644 --- a/lib/index.test.js +++ b/lib/index.test.js @@ -40,7 +40,7 @@ describe('format', () => { Promise.resolve( prettier.format(uglyJson, { filepath: 'package.json', - plugins: ['./lib/index.js'], + plugins: ['./lib/index.cjs'], }), ), ).resolves.toMatchSnapshot()) @@ -51,7 +51,7 @@ describe('format', () => { prettier.format(uglyJson, { parser: 'json-stringify', filepath: 'foo.json', - plugins: ['./lib/index.js'], + plugins: ['./lib/index.cjs'], }), ), ).resolves.toBe(uglyJson)) @@ -64,7 +64,7 @@ describe('format', () => { Promise.resolve( prettier.format(uglyJson, { filepath: 'package.json', - plugins: ['./lib/index.js'], + plugins: ['./lib/index.cjs'], }), ), ).resolves.toBe('{}\n') diff --git a/package.json b/package.json index 9ac693a..2f607fb 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ ], "repository": "github:matzkoh/prettier-plugin-packagejson", "license": "MIT", - "main": "lib", + "main": "lib/index.cjs", "directories": { "lib": "lib" }, diff --git a/prettier.config.js b/prettier.config.cjs similarity index 83% rename from prettier.config.js rename to prettier.config.cjs index 0585ffd..55e174c 100644 --- a/prettier.config.js +++ b/prettier.config.cjs @@ -5,5 +5,5 @@ module.exports = { semi: false, singleQuote: true, trailingComma: 'all', - plugins: ['./lib/index.js'], + plugins: ['./lib/index.cjs'], }