Skip to content

Commit

Permalink
fix: .js to .cjs for compatibility with { "type": "module" }
Browse files Browse the repository at this point in the history
  • Loading branch information
matzkoh committed Feb 15, 2024
1 parent 71868b8 commit ac3a006
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('format', () => {
Promise.resolve(
prettier.format(uglyJson, {
filepath: 'package.json',
plugins: ['./lib/index.js'],
plugins: ['./lib/index.cjs'],
}),
),
).resolves.toMatchSnapshot())
Expand All @@ -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))
Expand All @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"repository": "github:matzkoh/prettier-plugin-packagejson",
"license": "MIT",
"main": "lib",
"main": "lib/index.cjs",
"directories": {
"lib": "lib"
},
Expand Down
2 changes: 1 addition & 1 deletion prettier.config.js → prettier.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
plugins: ['./lib/index.js'],
plugins: ['./lib/index.cjs'],
}

0 comments on commit ac3a006

Please sign in to comment.