From 69a68d8211f1c69a605027ad1c5f4c05729f47cc Mon Sep 17 00:00:00 2001 From: Shuhei Hayashibara Date: Sun, 17 Dec 2023 02:27:13 +0900 Subject: [PATCH] fix: make `/standalone` entry work with `require()` (#2247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 build cjs output for backward compatibility This commit adds cjs output to rollup config. * chore: 🤖 add mapping for standalone.cjs * chore: 🤖 include standalone.cjs as package source * chore: 🤖 migrate .js files to .mjs * chore: 🤖 disable ESM as default * refactor: 💡 delete unnecessary export * chore: 🤖 revert build config * chore: 🤖 add require to exports Without this require, vscode-prettier can't resolve php plugin * refactor: 💡 fix link in comments * refactor: 💡 match both .js and .mjs for jest target * Remove `require` * Add a comment --------- Co-authored-by: fisker Cheung --- .eslintrc.yml | 4 ++-- build/{rollup.config.js => rollup.config.mjs} | 6 +++--- build/shims/{assert.js => assert.mjs} | 0 build/shims/{buffer.js => buffer.mjs} | 0 jest.config.js => jest.config.mjs | 7 ++++--- package.json | 5 ++--- src/{clean.js => clean.mjs} | 2 +- src/{comments.js => comments.mjs} | 6 +++--- src/{index.js => index.mjs} | 14 +++++++------- src/{loc.js => loc.mjs} | 0 src/{needs-parens.js => needs-parens.mjs} | 2 +- src/{options.js => options.mjs} | 0 src/{parser.js => parser.mjs} | 0 src/{pragma.js => pragma.mjs} | 2 +- src/{printer.js => printer.mjs} | 10 +++++----- src/{util.js => util.mjs} | 2 +- .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/array/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/arrowfunc/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/assign/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/assignref/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/attributes/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/bin/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/block/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/boolean/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../brace-style/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/break/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/call/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/case/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/cast/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/class/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/clone/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/closure/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/comments/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/constant/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/continue/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/declare/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/do/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/echo/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/empty/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/encapsed/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/enum/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/errors/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/eval/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/exit/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/extensions/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/for/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/foreach/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/formatting/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/functions/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/global/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/goto/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/halt/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/if/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/ignore/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/include/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/inline/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/interface/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/isset/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../kitchen_sink/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/list/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/magic/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/markdown/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/match/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../member_chain/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/method/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/namespace/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/new/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/newline/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/nowdoc/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/number/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../offsetlookup/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/parameter/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/parens/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/print/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/program/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/property/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/retif/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/return/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/shebang/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/silent/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/statement/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/static/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../staticlookup/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/string/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/switch/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../syntax-error/{jsfmt.spec.js => jsfmt.spec.mjs} | 2 +- .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/sys/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 .../{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/traitalias/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/traits/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/traituse/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/uniontypes/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/unset/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/use/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/variable/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/variadic/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/while/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 .../{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} | 0 tests/yield/{jsfmt.spec.js => jsfmt.spec.mjs} | 0 tests_config/{get_engine.js => get_engine.mjs} | 2 +- tests_config/{run_spec.js => run_spec.mjs} | 4 ++-- 212 files changed, 34 insertions(+), 34 deletions(-) rename build/{rollup.config.js => rollup.config.mjs} (93%) rename build/shims/{assert.js => assert.mjs} (100%) rename build/shims/{buffer.js => buffer.mjs} (100%) rename jest.config.js => jest.config.mjs (70%) rename src/{clean.js => clean.mjs} (97%) rename src/{comments.js => comments.mjs} (99%) rename src/{index.js => index.mjs} (93%) rename src/{loc.js => loc.mjs} (100%) rename src/{needs-parens.js => needs-parens.mjs} (99%) rename src/{options.js => options.mjs} (100%) rename src/{parser.js => parser.mjs} (100%) rename src/{pragma.js => pragma.mjs} (98%) rename src/{printer.js => printer.mjs} (99%) rename src/{util.js => util.mjs} (99%) rename tests/array/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/array/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/arrowfunc/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/arrowfunc/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/assign/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/assign/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/assignref/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/assignref/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/attributes-trail-comma/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/attributes-trail-comma/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/attributes/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/attributes/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/bin/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/bin/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/block/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/block/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/boolean/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/boolean/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/brace-style/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/brace-style/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/break/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/break/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/call/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/call/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/case/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/case/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/cast/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/cast/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/class/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/class/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/classconstant/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/classconstant/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/clone/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/clone/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/closure/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/closure/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/comments/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/comments/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/constant/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/constant/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/continue/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/continue/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/declare/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/declare/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/do/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/do/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/echo/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/echo/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/empty/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/empty/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/encapsed/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/encapsed/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/enum/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/enum/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/errors/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/errors/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/eval/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/eval/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/exit/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/exit/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/extensions/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/extensions/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/for/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/for/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/foreach/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/foreach/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/formatting/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/formatting/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/functions/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/functions/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/global/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/global/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/goto/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/goto/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/halt/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/halt/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/identifier-and-reference/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/identifier-and-reference/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/if/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/if/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/ignore/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/ignore/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/include/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/include/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/inline/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/inline/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/insert-pragma/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/insert-pragma/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/interface/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/interface/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/intersection-types/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/intersection-types/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/isset/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/isset/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/kitchen_sink/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/kitchen_sink/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/list/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/list/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/magic/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/magic/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/markdown/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/markdown/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/match/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/match/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/member_chain/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/member_chain/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/method/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/method/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/namedarguments/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/namedarguments/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/namespace/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/namespace/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/new/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/new/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/newline/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/newline/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/nowdoc/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/nowdoc/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/nullsafepropertylookup/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/nullsafepropertylookup/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/number/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/number/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/offsetlookup/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/offsetlookup/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/parameter/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/parameter/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/parens/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/parens/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/preserve_line/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/preserve_line/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/print/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/print/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/program/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/program/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/property/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/property/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/propertylookup/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/propertylookup/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/propertystatement/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/propertystatement/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/require-pragma/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/require-pragma/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/retif/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/retif/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/return/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/return/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/shebang/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/shebang/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/silent/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/silent/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/statement/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/statement/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/static/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/static/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/staticlookup/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/staticlookup/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/string-double-quote/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/string-double-quote/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/string-single-quote/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/string-single-quote/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/string/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/string/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/switch/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/switch/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/syntax-error/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/syntax-error/{jsfmt.spec.js => jsfmt.spec.mjs} (99%) rename tests/sys/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/sys/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/trailing_comma_func/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/trailing_comma_func/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/trailing_commas/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/trailing_commas/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/trailing_whitespace/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/trailing_whitespace/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/traitalias/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/traitalias/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/traits/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/traits/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/traituse/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/traituse/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/uniontypes/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/uniontypes/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/unset/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/unset/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/use/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/use/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/variable/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/variable/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/variadic/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/variadic/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/while/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/while/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests/yield/__snapshots__/{jsfmt.spec.js.snap => jsfmt.spec.mjs.snap} (100%) rename tests/yield/{jsfmt.spec.js => jsfmt.spec.mjs} (100%) rename tests_config/{get_engine.js => get_engine.mjs} (88%) rename tests_config/{run_spec.js => run_spec.mjs} (98%) diff --git a/.eslintrc.yml b/.eslintrc.yml index ac20038b3..e5a44beea 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -47,9 +47,9 @@ overrides: - files: "**/*.cjs" parserOptions: sourceType: "script" - - files: "tests/**/*.js" + - files: "tests/**/*.mjs" globals: run_spec: true - - files: "build/*.js" + - files: "build/*.mjs" parserOptions: sourceType: module diff --git a/build/rollup.config.js b/build/rollup.config.mjs similarity index 93% rename from build/rollup.config.js rename to build/rollup.config.mjs index c1c8208f9..8fa108523 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.mjs @@ -12,7 +12,7 @@ import terser from "@rollup/plugin-terser"; const getPath = (file) => url.fileURLToPath(new URL(file, import.meta.url)); export default { - input: getPath("../src/index.js"), + input: getPath("../src/index.mjs"), output: { file: "standalone.js", format: "umd", @@ -32,10 +32,10 @@ export default { }), commonjs(), alias({ - entries: [{ find: "assert", replacement: getPath("./shims/assert.js") }], + entries: [{ find: "assert", replacement: getPath("./shims/assert.mjs") }], }), inject({ - Buffer: getPath("./shims/buffer.js"), + Buffer: getPath("./shims/buffer.mjs"), }), replace({ preventAssignment: true, diff --git a/build/shims/assert.js b/build/shims/assert.mjs similarity index 100% rename from build/shims/assert.js rename to build/shims/assert.mjs diff --git a/build/shims/buffer.js b/build/shims/buffer.mjs similarity index 100% rename from build/shims/buffer.js rename to build/shims/buffer.mjs diff --git a/jest.config.js b/jest.config.mjs similarity index 70% rename from jest.config.js rename to jest.config.mjs index 686fc9fd3..41902fa1a 100644 --- a/jest.config.js +++ b/jest.config.mjs @@ -6,14 +6,15 @@ const RUN_STANDALONE_TESTS = Boolean(process.env.RUN_STANDALONE_TESTS); export default { // collectCoverage: ENABLE_COVERAGE, collectCoverageFrom: [ - "/src/**/*.js", + "/src/**/*.mjs", "!/node_modules/", "!/tests_config/", ], runner: "jest-light-runner", transform: {}, - setupFiles: ["/tests_config/run_spec.js"], - testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$", + setupFiles: ["/tests_config/run_spec.mjs"], + // Matches `.js` file to prevent files use `.js` extension by mistake, https://github.com/prettier/plugin-php/pull/2247#discussion_r1331847801 + testRegex: "jsfmt\\.spec\\.m?js$|__tests__/.*\\.m?js$", snapshotSerializers: ["jest-snapshot-serializer-raw"], globals: { STANDALONE: RUN_STANDALONE_TESTS, diff --git a/package.json b/package.json index 64d56a2fd..43704ddb1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "repository": "prettier/prettier-php", "author": "Lucas Azzola <@azz>", "license": "MIT", - "type": "module", "unpkg": "./standalone.js", "browser": "./standalone.js", "exports": { @@ -65,8 +64,8 @@ "test:node": "jest", "test:standalone": "yarn run build && cross-env RUN_STANDALONE_TESTS=true yarn jest", "prepublishOnly": "yarn test", - "prettier": "prettier --plugin=src/index.js --parser=php", - "build": "rollup --config build/rollup.config.js", + "prettier": "prettier --plugin=src/index.mjs --parser=php", + "build": "rollup --config build/rollup.config.mjs", "debug": "node --inspect-brk node_modules/.bin/jest --runInBand" }, "c8": { diff --git a/src/clean.js b/src/clean.mjs similarity index 97% rename from src/clean.js rename to src/clean.mjs index dca8766e3..3622417ca 100644 --- a/src/clean.js +++ b/src/clean.mjs @@ -1,4 +1,4 @@ -import { printNumber, normalizeMagicMethodName } from "./util.js"; +import { printNumber, normalizeMagicMethodName } from "./util.mjs"; const ignoredProperties = new Set([ "loc", diff --git a/src/comments.js b/src/comments.mjs similarity index 99% rename from src/comments.js rename to src/comments.mjs index bfa61042a..828fc0162 100644 --- a/src/comments.js +++ b/src/comments.mjs @@ -1,6 +1,6 @@ import { util as prettierUtil, doc } from "prettier"; -import { isLookupNode } from "./util.js"; -import { locStart, locEnd } from "./loc.js"; +import { isLookupNode } from "./util.mjs"; +import { locStart, locEnd } from "./loc.mjs"; const { addLeadingComment, @@ -830,7 +830,7 @@ function printComment(path, options) { return options.printer.printComment(path, options); } -// https://github.com/prettier/prettier/blob/master/src/main/comments.js#L440 +// https://github.com/prettier/prettier/blob/6bff776efd0951b7812818d02d1cae3fda184737/src/main/comments/print.js#L119 function printDanglingComments(path, options, sameIndent, filter) { const parts = []; const node = path.getValue(); diff --git a/src/index.js b/src/index.mjs similarity index 93% rename from src/index.js rename to src/index.mjs index 1d9009556..3450e965c 100644 --- a/src/index.js +++ b/src/index.mjs @@ -3,10 +3,10 @@ import { LINGUIST_LANGUAGES_PHP, LINGUIST_LANGUAGES_HTML_PHP, } from "./linguist-languages.cjs"; -import parse from "./parser.js"; -import print from "./printer.js"; -import clean from "./clean.js"; -import options from "./options.js"; +import parse from "./parser.mjs"; +import print from "./printer.mjs"; +import clean from "./clean.mjs"; +import options from "./options.mjs"; import { handleOwnLineComment, handleEndOfLineComment, @@ -14,9 +14,9 @@ import { getCommentChildNodes, canAttachComment, isBlockComment, -} from "./comments.js"; -import { hasPragma, insertPragma } from "./pragma.js"; -import { locStart, locEnd } from "./loc.js"; +} from "./comments.mjs"; +import { hasPragma, insertPragma } from "./pragma.mjs"; +import { locStart, locEnd } from "./loc.mjs"; const { join, hardline } = doc.builders; diff --git a/src/loc.js b/src/loc.mjs similarity index 100% rename from src/loc.js rename to src/loc.mjs diff --git a/src/needs-parens.js b/src/needs-parens.mjs similarity index 99% rename from src/needs-parens.js rename to src/needs-parens.mjs index a4db2cd77..00fca2c07 100644 --- a/src/needs-parens.js +++ b/src/needs-parens.mjs @@ -1,4 +1,4 @@ -import { getPrecedence, shouldFlatten, isBitwiseOperator } from "./util.js"; +import { getPrecedence, shouldFlatten, isBitwiseOperator } from "./util.mjs"; function needsParens(path) { const { parent } = path; diff --git a/src/options.js b/src/options.mjs similarity index 100% rename from src/options.js rename to src/options.mjs diff --git a/src/parser.js b/src/parser.mjs similarity index 100% rename from src/parser.js rename to src/parser.mjs diff --git a/src/pragma.js b/src/pragma.mjs similarity index 98% rename from src/pragma.js rename to src/pragma.mjs index 0647dbd51..cb48dc4f5 100644 --- a/src/pragma.js +++ b/src/pragma.mjs @@ -1,5 +1,5 @@ import memoize from "mem"; -import parse from "./parser.js"; +import parse from "./parser.mjs"; const reHasPragma = /@prettier|@format/; diff --git a/src/printer.js b/src/printer.mjs similarity index 99% rename from src/printer.js rename to src/printer.mjs index 79a010b00..52b940f53 100644 --- a/src/printer.js +++ b/src/printer.mjs @@ -7,9 +7,9 @@ import { printComments, isBlockComment, hasLeadingOwnLineComment, -} from "./comments.js"; -import pathNeedsParens from "./needs-parens.js"; -import { locStart, locEnd } from "./loc.js"; +} from "./comments.mjs"; +import pathNeedsParens from "./needs-parens.mjs"; +import { locStart, locEnd } from "./loc.mjs"; import { getLast, @@ -36,7 +36,7 @@ import { getAncestorNode, isReferenceLikeNode, normalizeMagicMethodName, -} from "./util.js"; +} from "./util.mjs"; const { breakParent, @@ -1753,7 +1753,7 @@ function printNode(path, options, print) { if (node.value) { return group([ name, - // see handleFunctionParameter() in ./comments.js - since there's + // see handleFunctionParameter() in ./comments.mjs - since there's // no node to attach comments that fall in between the parameter name // and value, we store them as dangling comments hasDanglingComments(node) ? " " : "", diff --git a/src/util.js b/src/util.mjs similarity index 99% rename from src/util.js rename to src/util.mjs index 513889e51..f54e9af8f 100644 --- a/src/util.js +++ b/src/util.mjs @@ -1,5 +1,5 @@ import { util as prettierUtil } from "prettier"; -import { locStart } from "./loc.js"; +import { locStart } from "./loc.mjs"; const { hasNewline, skipEverythingButNewLine, skipNewline } = prettierUtil; diff --git a/tests/array/__snapshots__/jsfmt.spec.js.snap b/tests/array/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/array/__snapshots__/jsfmt.spec.js.snap rename to tests/array/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/array/jsfmt.spec.js b/tests/array/jsfmt.spec.mjs similarity index 100% rename from tests/array/jsfmt.spec.js rename to tests/array/jsfmt.spec.mjs diff --git a/tests/arrowfunc/__snapshots__/jsfmt.spec.js.snap b/tests/arrowfunc/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/arrowfunc/__snapshots__/jsfmt.spec.js.snap rename to tests/arrowfunc/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/arrowfunc/jsfmt.spec.js b/tests/arrowfunc/jsfmt.spec.mjs similarity index 100% rename from tests/arrowfunc/jsfmt.spec.js rename to tests/arrowfunc/jsfmt.spec.mjs diff --git a/tests/assign/__snapshots__/jsfmt.spec.js.snap b/tests/assign/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/assign/__snapshots__/jsfmt.spec.js.snap rename to tests/assign/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/assign/jsfmt.spec.js b/tests/assign/jsfmt.spec.mjs similarity index 100% rename from tests/assign/jsfmt.spec.js rename to tests/assign/jsfmt.spec.mjs diff --git a/tests/assignref/__snapshots__/jsfmt.spec.js.snap b/tests/assignref/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/assignref/__snapshots__/jsfmt.spec.js.snap rename to tests/assignref/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/assignref/jsfmt.spec.js b/tests/assignref/jsfmt.spec.mjs similarity index 100% rename from tests/assignref/jsfmt.spec.js rename to tests/assignref/jsfmt.spec.mjs diff --git a/tests/attributes-trail-comma/__snapshots__/jsfmt.spec.js.snap b/tests/attributes-trail-comma/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/attributes-trail-comma/__snapshots__/jsfmt.spec.js.snap rename to tests/attributes-trail-comma/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/attributes-trail-comma/jsfmt.spec.js b/tests/attributes-trail-comma/jsfmt.spec.mjs similarity index 100% rename from tests/attributes-trail-comma/jsfmt.spec.js rename to tests/attributes-trail-comma/jsfmt.spec.mjs diff --git a/tests/attributes/__snapshots__/jsfmt.spec.js.snap b/tests/attributes/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/attributes/__snapshots__/jsfmt.spec.js.snap rename to tests/attributes/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/attributes/jsfmt.spec.js b/tests/attributes/jsfmt.spec.mjs similarity index 100% rename from tests/attributes/jsfmt.spec.js rename to tests/attributes/jsfmt.spec.mjs diff --git a/tests/bin/__snapshots__/jsfmt.spec.js.snap b/tests/bin/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/bin/__snapshots__/jsfmt.spec.js.snap rename to tests/bin/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/bin/jsfmt.spec.js b/tests/bin/jsfmt.spec.mjs similarity index 100% rename from tests/bin/jsfmt.spec.js rename to tests/bin/jsfmt.spec.mjs diff --git a/tests/block/__snapshots__/jsfmt.spec.js.snap b/tests/block/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/block/__snapshots__/jsfmt.spec.js.snap rename to tests/block/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/block/jsfmt.spec.js b/tests/block/jsfmt.spec.mjs similarity index 100% rename from tests/block/jsfmt.spec.js rename to tests/block/jsfmt.spec.mjs diff --git a/tests/boolean/__snapshots__/jsfmt.spec.js.snap b/tests/boolean/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/boolean/__snapshots__/jsfmt.spec.js.snap rename to tests/boolean/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/boolean/jsfmt.spec.js b/tests/boolean/jsfmt.spec.mjs similarity index 100% rename from tests/boolean/jsfmt.spec.js rename to tests/boolean/jsfmt.spec.mjs diff --git a/tests/brace-style/__snapshots__/jsfmt.spec.js.snap b/tests/brace-style/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/brace-style/__snapshots__/jsfmt.spec.js.snap rename to tests/brace-style/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/brace-style/jsfmt.spec.js b/tests/brace-style/jsfmt.spec.mjs similarity index 100% rename from tests/brace-style/jsfmt.spec.js rename to tests/brace-style/jsfmt.spec.mjs diff --git a/tests/break/__snapshots__/jsfmt.spec.js.snap b/tests/break/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/break/__snapshots__/jsfmt.spec.js.snap rename to tests/break/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/break/jsfmt.spec.js b/tests/break/jsfmt.spec.mjs similarity index 100% rename from tests/break/jsfmt.spec.js rename to tests/break/jsfmt.spec.mjs diff --git a/tests/call/__snapshots__/jsfmt.spec.js.snap b/tests/call/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/call/__snapshots__/jsfmt.spec.js.snap rename to tests/call/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/call/jsfmt.spec.js b/tests/call/jsfmt.spec.mjs similarity index 100% rename from tests/call/jsfmt.spec.js rename to tests/call/jsfmt.spec.mjs diff --git a/tests/case/__snapshots__/jsfmt.spec.js.snap b/tests/case/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/case/__snapshots__/jsfmt.spec.js.snap rename to tests/case/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/case/jsfmt.spec.js b/tests/case/jsfmt.spec.mjs similarity index 100% rename from tests/case/jsfmt.spec.js rename to tests/case/jsfmt.spec.mjs diff --git a/tests/cast/__snapshots__/jsfmt.spec.js.snap b/tests/cast/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/cast/__snapshots__/jsfmt.spec.js.snap rename to tests/cast/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/cast/jsfmt.spec.js b/tests/cast/jsfmt.spec.mjs similarity index 100% rename from tests/cast/jsfmt.spec.js rename to tests/cast/jsfmt.spec.mjs diff --git a/tests/class/__snapshots__/jsfmt.spec.js.snap b/tests/class/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/class/__snapshots__/jsfmt.spec.js.snap rename to tests/class/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/class/jsfmt.spec.js b/tests/class/jsfmt.spec.mjs similarity index 100% rename from tests/class/jsfmt.spec.js rename to tests/class/jsfmt.spec.mjs diff --git a/tests/classconstant/__snapshots__/jsfmt.spec.js.snap b/tests/classconstant/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/classconstant/__snapshots__/jsfmt.spec.js.snap rename to tests/classconstant/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/classconstant/jsfmt.spec.js b/tests/classconstant/jsfmt.spec.mjs similarity index 100% rename from tests/classconstant/jsfmt.spec.js rename to tests/classconstant/jsfmt.spec.mjs diff --git a/tests/clone/__snapshots__/jsfmt.spec.js.snap b/tests/clone/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/clone/__snapshots__/jsfmt.spec.js.snap rename to tests/clone/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/clone/jsfmt.spec.js b/tests/clone/jsfmt.spec.mjs similarity index 100% rename from tests/clone/jsfmt.spec.js rename to tests/clone/jsfmt.spec.mjs diff --git a/tests/closure/__snapshots__/jsfmt.spec.js.snap b/tests/closure/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/closure/__snapshots__/jsfmt.spec.js.snap rename to tests/closure/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/closure/jsfmt.spec.js b/tests/closure/jsfmt.spec.mjs similarity index 100% rename from tests/closure/jsfmt.spec.js rename to tests/closure/jsfmt.spec.mjs diff --git a/tests/comments/__snapshots__/jsfmt.spec.js.snap b/tests/comments/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/comments/__snapshots__/jsfmt.spec.js.snap rename to tests/comments/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/comments/jsfmt.spec.js b/tests/comments/jsfmt.spec.mjs similarity index 100% rename from tests/comments/jsfmt.spec.js rename to tests/comments/jsfmt.spec.mjs diff --git a/tests/constant/__snapshots__/jsfmt.spec.js.snap b/tests/constant/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/constant/__snapshots__/jsfmt.spec.js.snap rename to tests/constant/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/constant/jsfmt.spec.js b/tests/constant/jsfmt.spec.mjs similarity index 100% rename from tests/constant/jsfmt.spec.js rename to tests/constant/jsfmt.spec.mjs diff --git a/tests/continue/__snapshots__/jsfmt.spec.js.snap b/tests/continue/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/continue/__snapshots__/jsfmt.spec.js.snap rename to tests/continue/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/continue/jsfmt.spec.js b/tests/continue/jsfmt.spec.mjs similarity index 100% rename from tests/continue/jsfmt.spec.js rename to tests/continue/jsfmt.spec.mjs diff --git a/tests/declare/__snapshots__/jsfmt.spec.js.snap b/tests/declare/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/declare/__snapshots__/jsfmt.spec.js.snap rename to tests/declare/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/declare/jsfmt.spec.js b/tests/declare/jsfmt.spec.mjs similarity index 100% rename from tests/declare/jsfmt.spec.js rename to tests/declare/jsfmt.spec.mjs diff --git a/tests/do/__snapshots__/jsfmt.spec.js.snap b/tests/do/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/do/__snapshots__/jsfmt.spec.js.snap rename to tests/do/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/do/jsfmt.spec.js b/tests/do/jsfmt.spec.mjs similarity index 100% rename from tests/do/jsfmt.spec.js rename to tests/do/jsfmt.spec.mjs diff --git a/tests/echo/__snapshots__/jsfmt.spec.js.snap b/tests/echo/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/echo/__snapshots__/jsfmt.spec.js.snap rename to tests/echo/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/echo/jsfmt.spec.js b/tests/echo/jsfmt.spec.mjs similarity index 100% rename from tests/echo/jsfmt.spec.js rename to tests/echo/jsfmt.spec.mjs diff --git a/tests/empty/__snapshots__/jsfmt.spec.js.snap b/tests/empty/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/empty/__snapshots__/jsfmt.spec.js.snap rename to tests/empty/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/empty/jsfmt.spec.js b/tests/empty/jsfmt.spec.mjs similarity index 100% rename from tests/empty/jsfmt.spec.js rename to tests/empty/jsfmt.spec.mjs diff --git a/tests/encapsed/__snapshots__/jsfmt.spec.js.snap b/tests/encapsed/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/encapsed/__snapshots__/jsfmt.spec.js.snap rename to tests/encapsed/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/encapsed/jsfmt.spec.js b/tests/encapsed/jsfmt.spec.mjs similarity index 100% rename from tests/encapsed/jsfmt.spec.js rename to tests/encapsed/jsfmt.spec.mjs diff --git a/tests/enum/__snapshots__/jsfmt.spec.js.snap b/tests/enum/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/enum/__snapshots__/jsfmt.spec.js.snap rename to tests/enum/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/enum/jsfmt.spec.js b/tests/enum/jsfmt.spec.mjs similarity index 100% rename from tests/enum/jsfmt.spec.js rename to tests/enum/jsfmt.spec.mjs diff --git a/tests/errors/__snapshots__/jsfmt.spec.js.snap b/tests/errors/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/errors/__snapshots__/jsfmt.spec.js.snap rename to tests/errors/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/errors/jsfmt.spec.js b/tests/errors/jsfmt.spec.mjs similarity index 100% rename from tests/errors/jsfmt.spec.js rename to tests/errors/jsfmt.spec.mjs diff --git a/tests/eval/__snapshots__/jsfmt.spec.js.snap b/tests/eval/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/eval/__snapshots__/jsfmt.spec.js.snap rename to tests/eval/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/eval/jsfmt.spec.js b/tests/eval/jsfmt.spec.mjs similarity index 100% rename from tests/eval/jsfmt.spec.js rename to tests/eval/jsfmt.spec.mjs diff --git a/tests/exit/__snapshots__/jsfmt.spec.js.snap b/tests/exit/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/exit/__snapshots__/jsfmt.spec.js.snap rename to tests/exit/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/exit/jsfmt.spec.js b/tests/exit/jsfmt.spec.mjs similarity index 100% rename from tests/exit/jsfmt.spec.js rename to tests/exit/jsfmt.spec.mjs diff --git a/tests/extensions/__snapshots__/jsfmt.spec.js.snap b/tests/extensions/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/extensions/__snapshots__/jsfmt.spec.js.snap rename to tests/extensions/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/extensions/jsfmt.spec.js b/tests/extensions/jsfmt.spec.mjs similarity index 100% rename from tests/extensions/jsfmt.spec.js rename to tests/extensions/jsfmt.spec.mjs diff --git a/tests/for/__snapshots__/jsfmt.spec.js.snap b/tests/for/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/for/__snapshots__/jsfmt.spec.js.snap rename to tests/for/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/for/jsfmt.spec.js b/tests/for/jsfmt.spec.mjs similarity index 100% rename from tests/for/jsfmt.spec.js rename to tests/for/jsfmt.spec.mjs diff --git a/tests/foreach/__snapshots__/jsfmt.spec.js.snap b/tests/foreach/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/foreach/__snapshots__/jsfmt.spec.js.snap rename to tests/foreach/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/foreach/jsfmt.spec.js b/tests/foreach/jsfmt.spec.mjs similarity index 100% rename from tests/foreach/jsfmt.spec.js rename to tests/foreach/jsfmt.spec.mjs diff --git a/tests/formatting/__snapshots__/jsfmt.spec.js.snap b/tests/formatting/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/formatting/__snapshots__/jsfmt.spec.js.snap rename to tests/formatting/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/formatting/jsfmt.spec.js b/tests/formatting/jsfmt.spec.mjs similarity index 100% rename from tests/formatting/jsfmt.spec.js rename to tests/formatting/jsfmt.spec.mjs diff --git a/tests/functions/__snapshots__/jsfmt.spec.js.snap b/tests/functions/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/functions/__snapshots__/jsfmt.spec.js.snap rename to tests/functions/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/functions/jsfmt.spec.js b/tests/functions/jsfmt.spec.mjs similarity index 100% rename from tests/functions/jsfmt.spec.js rename to tests/functions/jsfmt.spec.mjs diff --git a/tests/global/__snapshots__/jsfmt.spec.js.snap b/tests/global/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/global/__snapshots__/jsfmt.spec.js.snap rename to tests/global/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/global/jsfmt.spec.js b/tests/global/jsfmt.spec.mjs similarity index 100% rename from tests/global/jsfmt.spec.js rename to tests/global/jsfmt.spec.mjs diff --git a/tests/goto/__snapshots__/jsfmt.spec.js.snap b/tests/goto/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/goto/__snapshots__/jsfmt.spec.js.snap rename to tests/goto/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/goto/jsfmt.spec.js b/tests/goto/jsfmt.spec.mjs similarity index 100% rename from tests/goto/jsfmt.spec.js rename to tests/goto/jsfmt.spec.mjs diff --git a/tests/halt/__snapshots__/jsfmt.spec.js.snap b/tests/halt/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/halt/__snapshots__/jsfmt.spec.js.snap rename to tests/halt/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/halt/jsfmt.spec.js b/tests/halt/jsfmt.spec.mjs similarity index 100% rename from tests/halt/jsfmt.spec.js rename to tests/halt/jsfmt.spec.mjs diff --git a/tests/identifier-and-reference/__snapshots__/jsfmt.spec.js.snap b/tests/identifier-and-reference/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/identifier-and-reference/__snapshots__/jsfmt.spec.js.snap rename to tests/identifier-and-reference/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/identifier-and-reference/jsfmt.spec.js b/tests/identifier-and-reference/jsfmt.spec.mjs similarity index 100% rename from tests/identifier-and-reference/jsfmt.spec.js rename to tests/identifier-and-reference/jsfmt.spec.mjs diff --git a/tests/if/__snapshots__/jsfmt.spec.js.snap b/tests/if/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/if/__snapshots__/jsfmt.spec.js.snap rename to tests/if/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/if/jsfmt.spec.js b/tests/if/jsfmt.spec.mjs similarity index 100% rename from tests/if/jsfmt.spec.js rename to tests/if/jsfmt.spec.mjs diff --git a/tests/ignore/__snapshots__/jsfmt.spec.js.snap b/tests/ignore/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/ignore/__snapshots__/jsfmt.spec.js.snap rename to tests/ignore/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/ignore/jsfmt.spec.js b/tests/ignore/jsfmt.spec.mjs similarity index 100% rename from tests/ignore/jsfmt.spec.js rename to tests/ignore/jsfmt.spec.mjs diff --git a/tests/include/__snapshots__/jsfmt.spec.js.snap b/tests/include/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/include/__snapshots__/jsfmt.spec.js.snap rename to tests/include/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/include/jsfmt.spec.js b/tests/include/jsfmt.spec.mjs similarity index 100% rename from tests/include/jsfmt.spec.js rename to tests/include/jsfmt.spec.mjs diff --git a/tests/inline/__snapshots__/jsfmt.spec.js.snap b/tests/inline/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/inline/__snapshots__/jsfmt.spec.js.snap rename to tests/inline/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/inline/jsfmt.spec.js b/tests/inline/jsfmt.spec.mjs similarity index 100% rename from tests/inline/jsfmt.spec.js rename to tests/inline/jsfmt.spec.mjs diff --git a/tests/insert-pragma/__snapshots__/jsfmt.spec.js.snap b/tests/insert-pragma/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/insert-pragma/__snapshots__/jsfmt.spec.js.snap rename to tests/insert-pragma/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/insert-pragma/jsfmt.spec.js b/tests/insert-pragma/jsfmt.spec.mjs similarity index 100% rename from tests/insert-pragma/jsfmt.spec.js rename to tests/insert-pragma/jsfmt.spec.mjs diff --git a/tests/interface/__snapshots__/jsfmt.spec.js.snap b/tests/interface/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/interface/__snapshots__/jsfmt.spec.js.snap rename to tests/interface/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/interface/jsfmt.spec.js b/tests/interface/jsfmt.spec.mjs similarity index 100% rename from tests/interface/jsfmt.spec.js rename to tests/interface/jsfmt.spec.mjs diff --git a/tests/intersection-types/__snapshots__/jsfmt.spec.js.snap b/tests/intersection-types/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/intersection-types/__snapshots__/jsfmt.spec.js.snap rename to tests/intersection-types/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/intersection-types/jsfmt.spec.js b/tests/intersection-types/jsfmt.spec.mjs similarity index 100% rename from tests/intersection-types/jsfmt.spec.js rename to tests/intersection-types/jsfmt.spec.mjs diff --git a/tests/isset/__snapshots__/jsfmt.spec.js.snap b/tests/isset/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/isset/__snapshots__/jsfmt.spec.js.snap rename to tests/isset/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/isset/jsfmt.spec.js b/tests/isset/jsfmt.spec.mjs similarity index 100% rename from tests/isset/jsfmt.spec.js rename to tests/isset/jsfmt.spec.mjs diff --git a/tests/kitchen_sink/__snapshots__/jsfmt.spec.js.snap b/tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/kitchen_sink/__snapshots__/jsfmt.spec.js.snap rename to tests/kitchen_sink/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/kitchen_sink/jsfmt.spec.js b/tests/kitchen_sink/jsfmt.spec.mjs similarity index 100% rename from tests/kitchen_sink/jsfmt.spec.js rename to tests/kitchen_sink/jsfmt.spec.mjs diff --git a/tests/list/__snapshots__/jsfmt.spec.js.snap b/tests/list/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/list/__snapshots__/jsfmt.spec.js.snap rename to tests/list/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/list/jsfmt.spec.js b/tests/list/jsfmt.spec.mjs similarity index 100% rename from tests/list/jsfmt.spec.js rename to tests/list/jsfmt.spec.mjs diff --git a/tests/magic/__snapshots__/jsfmt.spec.js.snap b/tests/magic/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/magic/__snapshots__/jsfmt.spec.js.snap rename to tests/magic/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/magic/jsfmt.spec.js b/tests/magic/jsfmt.spec.mjs similarity index 100% rename from tests/magic/jsfmt.spec.js rename to tests/magic/jsfmt.spec.mjs diff --git a/tests/markdown/__snapshots__/jsfmt.spec.js.snap b/tests/markdown/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/markdown/__snapshots__/jsfmt.spec.js.snap rename to tests/markdown/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/markdown/jsfmt.spec.js b/tests/markdown/jsfmt.spec.mjs similarity index 100% rename from tests/markdown/jsfmt.spec.js rename to tests/markdown/jsfmt.spec.mjs diff --git a/tests/match/__snapshots__/jsfmt.spec.js.snap b/tests/match/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/match/__snapshots__/jsfmt.spec.js.snap rename to tests/match/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/match/jsfmt.spec.js b/tests/match/jsfmt.spec.mjs similarity index 100% rename from tests/match/jsfmt.spec.js rename to tests/match/jsfmt.spec.mjs diff --git a/tests/member_chain/__snapshots__/jsfmt.spec.js.snap b/tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/member_chain/__snapshots__/jsfmt.spec.js.snap rename to tests/member_chain/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/member_chain/jsfmt.spec.js b/tests/member_chain/jsfmt.spec.mjs similarity index 100% rename from tests/member_chain/jsfmt.spec.js rename to tests/member_chain/jsfmt.spec.mjs diff --git a/tests/method/__snapshots__/jsfmt.spec.js.snap b/tests/method/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/method/__snapshots__/jsfmt.spec.js.snap rename to tests/method/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/method/jsfmt.spec.js b/tests/method/jsfmt.spec.mjs similarity index 100% rename from tests/method/jsfmt.spec.js rename to tests/method/jsfmt.spec.mjs diff --git a/tests/namedarguments/__snapshots__/jsfmt.spec.js.snap b/tests/namedarguments/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/namedarguments/__snapshots__/jsfmt.spec.js.snap rename to tests/namedarguments/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/namedarguments/jsfmt.spec.js b/tests/namedarguments/jsfmt.spec.mjs similarity index 100% rename from tests/namedarguments/jsfmt.spec.js rename to tests/namedarguments/jsfmt.spec.mjs diff --git a/tests/namespace/__snapshots__/jsfmt.spec.js.snap b/tests/namespace/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/namespace/__snapshots__/jsfmt.spec.js.snap rename to tests/namespace/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/namespace/jsfmt.spec.js b/tests/namespace/jsfmt.spec.mjs similarity index 100% rename from tests/namespace/jsfmt.spec.js rename to tests/namespace/jsfmt.spec.mjs diff --git a/tests/new/__snapshots__/jsfmt.spec.js.snap b/tests/new/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/new/__snapshots__/jsfmt.spec.js.snap rename to tests/new/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/new/jsfmt.spec.js b/tests/new/jsfmt.spec.mjs similarity index 100% rename from tests/new/jsfmt.spec.js rename to tests/new/jsfmt.spec.mjs diff --git a/tests/newline/__snapshots__/jsfmt.spec.js.snap b/tests/newline/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/newline/__snapshots__/jsfmt.spec.js.snap rename to tests/newline/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/newline/jsfmt.spec.js b/tests/newline/jsfmt.spec.mjs similarity index 100% rename from tests/newline/jsfmt.spec.js rename to tests/newline/jsfmt.spec.mjs diff --git a/tests/nowdoc/__snapshots__/jsfmt.spec.js.snap b/tests/nowdoc/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/nowdoc/__snapshots__/jsfmt.spec.js.snap rename to tests/nowdoc/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/nowdoc/jsfmt.spec.js b/tests/nowdoc/jsfmt.spec.mjs similarity index 100% rename from tests/nowdoc/jsfmt.spec.js rename to tests/nowdoc/jsfmt.spec.mjs diff --git a/tests/nullsafepropertylookup/__snapshots__/jsfmt.spec.js.snap b/tests/nullsafepropertylookup/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/nullsafepropertylookup/__snapshots__/jsfmt.spec.js.snap rename to tests/nullsafepropertylookup/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/nullsafepropertylookup/jsfmt.spec.js b/tests/nullsafepropertylookup/jsfmt.spec.mjs similarity index 100% rename from tests/nullsafepropertylookup/jsfmt.spec.js rename to tests/nullsafepropertylookup/jsfmt.spec.mjs diff --git a/tests/number/__snapshots__/jsfmt.spec.js.snap b/tests/number/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/number/__snapshots__/jsfmt.spec.js.snap rename to tests/number/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/number/jsfmt.spec.js b/tests/number/jsfmt.spec.mjs similarity index 100% rename from tests/number/jsfmt.spec.js rename to tests/number/jsfmt.spec.mjs diff --git a/tests/offsetlookup/__snapshots__/jsfmt.spec.js.snap b/tests/offsetlookup/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/offsetlookup/__snapshots__/jsfmt.spec.js.snap rename to tests/offsetlookup/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/offsetlookup/jsfmt.spec.js b/tests/offsetlookup/jsfmt.spec.mjs similarity index 100% rename from tests/offsetlookup/jsfmt.spec.js rename to tests/offsetlookup/jsfmt.spec.mjs diff --git a/tests/parameter/__snapshots__/jsfmt.spec.js.snap b/tests/parameter/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/parameter/__snapshots__/jsfmt.spec.js.snap rename to tests/parameter/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/parameter/jsfmt.spec.js b/tests/parameter/jsfmt.spec.mjs similarity index 100% rename from tests/parameter/jsfmt.spec.js rename to tests/parameter/jsfmt.spec.mjs diff --git a/tests/parens/__snapshots__/jsfmt.spec.js.snap b/tests/parens/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/parens/__snapshots__/jsfmt.spec.js.snap rename to tests/parens/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/parens/jsfmt.spec.js b/tests/parens/jsfmt.spec.mjs similarity index 100% rename from tests/parens/jsfmt.spec.js rename to tests/parens/jsfmt.spec.mjs diff --git a/tests/preserve_line/__snapshots__/jsfmt.spec.js.snap b/tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/preserve_line/__snapshots__/jsfmt.spec.js.snap rename to tests/preserve_line/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/preserve_line/jsfmt.spec.js b/tests/preserve_line/jsfmt.spec.mjs similarity index 100% rename from tests/preserve_line/jsfmt.spec.js rename to tests/preserve_line/jsfmt.spec.mjs diff --git a/tests/print/__snapshots__/jsfmt.spec.js.snap b/tests/print/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/print/__snapshots__/jsfmt.spec.js.snap rename to tests/print/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/print/jsfmt.spec.js b/tests/print/jsfmt.spec.mjs similarity index 100% rename from tests/print/jsfmt.spec.js rename to tests/print/jsfmt.spec.mjs diff --git a/tests/program/__snapshots__/jsfmt.spec.js.snap b/tests/program/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/program/__snapshots__/jsfmt.spec.js.snap rename to tests/program/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/program/jsfmt.spec.js b/tests/program/jsfmt.spec.mjs similarity index 100% rename from tests/program/jsfmt.spec.js rename to tests/program/jsfmt.spec.mjs diff --git a/tests/property/__snapshots__/jsfmt.spec.js.snap b/tests/property/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/property/__snapshots__/jsfmt.spec.js.snap rename to tests/property/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/property/jsfmt.spec.js b/tests/property/jsfmt.spec.mjs similarity index 100% rename from tests/property/jsfmt.spec.js rename to tests/property/jsfmt.spec.mjs diff --git a/tests/propertylookup/__snapshots__/jsfmt.spec.js.snap b/tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/propertylookup/__snapshots__/jsfmt.spec.js.snap rename to tests/propertylookup/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/propertylookup/jsfmt.spec.js b/tests/propertylookup/jsfmt.spec.mjs similarity index 100% rename from tests/propertylookup/jsfmt.spec.js rename to tests/propertylookup/jsfmt.spec.mjs diff --git a/tests/propertystatement/__snapshots__/jsfmt.spec.js.snap b/tests/propertystatement/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/propertystatement/__snapshots__/jsfmt.spec.js.snap rename to tests/propertystatement/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/propertystatement/jsfmt.spec.js b/tests/propertystatement/jsfmt.spec.mjs similarity index 100% rename from tests/propertystatement/jsfmt.spec.js rename to tests/propertystatement/jsfmt.spec.mjs diff --git a/tests/require-pragma/__snapshots__/jsfmt.spec.js.snap b/tests/require-pragma/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/require-pragma/__snapshots__/jsfmt.spec.js.snap rename to tests/require-pragma/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/require-pragma/jsfmt.spec.js b/tests/require-pragma/jsfmt.spec.mjs similarity index 100% rename from tests/require-pragma/jsfmt.spec.js rename to tests/require-pragma/jsfmt.spec.mjs diff --git a/tests/retif/__snapshots__/jsfmt.spec.js.snap b/tests/retif/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/retif/__snapshots__/jsfmt.spec.js.snap rename to tests/retif/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/retif/jsfmt.spec.js b/tests/retif/jsfmt.spec.mjs similarity index 100% rename from tests/retif/jsfmt.spec.js rename to tests/retif/jsfmt.spec.mjs diff --git a/tests/return/__snapshots__/jsfmt.spec.js.snap b/tests/return/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/return/__snapshots__/jsfmt.spec.js.snap rename to tests/return/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/return/jsfmt.spec.js b/tests/return/jsfmt.spec.mjs similarity index 100% rename from tests/return/jsfmt.spec.js rename to tests/return/jsfmt.spec.mjs diff --git a/tests/shebang/__snapshots__/jsfmt.spec.js.snap b/tests/shebang/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/shebang/__snapshots__/jsfmt.spec.js.snap rename to tests/shebang/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/shebang/jsfmt.spec.js b/tests/shebang/jsfmt.spec.mjs similarity index 100% rename from tests/shebang/jsfmt.spec.js rename to tests/shebang/jsfmt.spec.mjs diff --git a/tests/silent/__snapshots__/jsfmt.spec.js.snap b/tests/silent/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/silent/__snapshots__/jsfmt.spec.js.snap rename to tests/silent/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/silent/jsfmt.spec.js b/tests/silent/jsfmt.spec.mjs similarity index 100% rename from tests/silent/jsfmt.spec.js rename to tests/silent/jsfmt.spec.mjs diff --git a/tests/statement/__snapshots__/jsfmt.spec.js.snap b/tests/statement/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/statement/__snapshots__/jsfmt.spec.js.snap rename to tests/statement/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/statement/jsfmt.spec.js b/tests/statement/jsfmt.spec.mjs similarity index 100% rename from tests/statement/jsfmt.spec.js rename to tests/statement/jsfmt.spec.mjs diff --git a/tests/static/__snapshots__/jsfmt.spec.js.snap b/tests/static/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/static/__snapshots__/jsfmt.spec.js.snap rename to tests/static/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/static/jsfmt.spec.js b/tests/static/jsfmt.spec.mjs similarity index 100% rename from tests/static/jsfmt.spec.js rename to tests/static/jsfmt.spec.mjs diff --git a/tests/staticlookup/__snapshots__/jsfmt.spec.js.snap b/tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/staticlookup/__snapshots__/jsfmt.spec.js.snap rename to tests/staticlookup/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/staticlookup/jsfmt.spec.js b/tests/staticlookup/jsfmt.spec.mjs similarity index 100% rename from tests/staticlookup/jsfmt.spec.js rename to tests/staticlookup/jsfmt.spec.mjs diff --git a/tests/string-double-quote/__snapshots__/jsfmt.spec.js.snap b/tests/string-double-quote/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/string-double-quote/__snapshots__/jsfmt.spec.js.snap rename to tests/string-double-quote/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/string-double-quote/jsfmt.spec.js b/tests/string-double-quote/jsfmt.spec.mjs similarity index 100% rename from tests/string-double-quote/jsfmt.spec.js rename to tests/string-double-quote/jsfmt.spec.mjs diff --git a/tests/string-single-quote/__snapshots__/jsfmt.spec.js.snap b/tests/string-single-quote/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/string-single-quote/__snapshots__/jsfmt.spec.js.snap rename to tests/string-single-quote/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/string-single-quote/jsfmt.spec.js b/tests/string-single-quote/jsfmt.spec.mjs similarity index 100% rename from tests/string-single-quote/jsfmt.spec.js rename to tests/string-single-quote/jsfmt.spec.mjs diff --git a/tests/string/__snapshots__/jsfmt.spec.js.snap b/tests/string/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/string/__snapshots__/jsfmt.spec.js.snap rename to tests/string/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/string/jsfmt.spec.js b/tests/string/jsfmt.spec.mjs similarity index 100% rename from tests/string/jsfmt.spec.js rename to tests/string/jsfmt.spec.mjs diff --git a/tests/switch/__snapshots__/jsfmt.spec.js.snap b/tests/switch/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/switch/__snapshots__/jsfmt.spec.js.snap rename to tests/switch/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/switch/jsfmt.spec.js b/tests/switch/jsfmt.spec.mjs similarity index 100% rename from tests/switch/jsfmt.spec.js rename to tests/switch/jsfmt.spec.mjs diff --git a/tests/syntax-error/__snapshots__/jsfmt.spec.js.snap b/tests/syntax-error/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/syntax-error/__snapshots__/jsfmt.spec.js.snap rename to tests/syntax-error/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/syntax-error/jsfmt.spec.js b/tests/syntax-error/jsfmt.spec.mjs similarity index 99% rename from tests/syntax-error/jsfmt.spec.js rename to tests/syntax-error/jsfmt.spec.mjs index b712c6c85..ea94a15a3 100644 --- a/tests/syntax-error/jsfmt.spec.js +++ b/tests/syntax-error/jsfmt.spec.mjs @@ -1,4 +1,4 @@ -import { prettier, plugin } from "../../tests_config/get_engine.js"; +import { prettier, plugin } from "../../tests_config/get_engine.mjs"; import stripAnsi from "strip-ansi"; async function raiseSyntaxError() { diff --git a/tests/sys/__snapshots__/jsfmt.spec.js.snap b/tests/sys/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/sys/__snapshots__/jsfmt.spec.js.snap rename to tests/sys/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/sys/jsfmt.spec.js b/tests/sys/jsfmt.spec.mjs similarity index 100% rename from tests/sys/jsfmt.spec.js rename to tests/sys/jsfmt.spec.mjs diff --git a/tests/trailing_comma_func/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_comma_func/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/trailing_comma_func/__snapshots__/jsfmt.spec.js.snap rename to tests/trailing_comma_func/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/trailing_comma_func/jsfmt.spec.js b/tests/trailing_comma_func/jsfmt.spec.mjs similarity index 100% rename from tests/trailing_comma_func/jsfmt.spec.js rename to tests/trailing_comma_func/jsfmt.spec.mjs diff --git a/tests/trailing_commas/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/trailing_commas/__snapshots__/jsfmt.spec.js.snap rename to tests/trailing_commas/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/trailing_commas/jsfmt.spec.js b/tests/trailing_commas/jsfmt.spec.mjs similarity index 100% rename from tests/trailing_commas/jsfmt.spec.js rename to tests/trailing_commas/jsfmt.spec.mjs diff --git a/tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_whitespace/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap rename to tests/trailing_whitespace/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/trailing_whitespace/jsfmt.spec.js b/tests/trailing_whitespace/jsfmt.spec.mjs similarity index 100% rename from tests/trailing_whitespace/jsfmt.spec.js rename to tests/trailing_whitespace/jsfmt.spec.mjs diff --git a/tests/traitalias/__snapshots__/jsfmt.spec.js.snap b/tests/traitalias/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/traitalias/__snapshots__/jsfmt.spec.js.snap rename to tests/traitalias/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/traitalias/jsfmt.spec.js b/tests/traitalias/jsfmt.spec.mjs similarity index 100% rename from tests/traitalias/jsfmt.spec.js rename to tests/traitalias/jsfmt.spec.mjs diff --git a/tests/traits/__snapshots__/jsfmt.spec.js.snap b/tests/traits/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/traits/__snapshots__/jsfmt.spec.js.snap rename to tests/traits/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/traits/jsfmt.spec.js b/tests/traits/jsfmt.spec.mjs similarity index 100% rename from tests/traits/jsfmt.spec.js rename to tests/traits/jsfmt.spec.mjs diff --git a/tests/traituse/__snapshots__/jsfmt.spec.js.snap b/tests/traituse/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/traituse/__snapshots__/jsfmt.spec.js.snap rename to tests/traituse/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/traituse/jsfmt.spec.js b/tests/traituse/jsfmt.spec.mjs similarity index 100% rename from tests/traituse/jsfmt.spec.js rename to tests/traituse/jsfmt.spec.mjs diff --git a/tests/uniontypes/__snapshots__/jsfmt.spec.js.snap b/tests/uniontypes/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/uniontypes/__snapshots__/jsfmt.spec.js.snap rename to tests/uniontypes/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/uniontypes/jsfmt.spec.js b/tests/uniontypes/jsfmt.spec.mjs similarity index 100% rename from tests/uniontypes/jsfmt.spec.js rename to tests/uniontypes/jsfmt.spec.mjs diff --git a/tests/unset/__snapshots__/jsfmt.spec.js.snap b/tests/unset/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/unset/__snapshots__/jsfmt.spec.js.snap rename to tests/unset/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/unset/jsfmt.spec.js b/tests/unset/jsfmt.spec.mjs similarity index 100% rename from tests/unset/jsfmt.spec.js rename to tests/unset/jsfmt.spec.mjs diff --git a/tests/use/__snapshots__/jsfmt.spec.js.snap b/tests/use/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/use/__snapshots__/jsfmt.spec.js.snap rename to tests/use/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/use/jsfmt.spec.js b/tests/use/jsfmt.spec.mjs similarity index 100% rename from tests/use/jsfmt.spec.js rename to tests/use/jsfmt.spec.mjs diff --git a/tests/variable/__snapshots__/jsfmt.spec.js.snap b/tests/variable/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/variable/__snapshots__/jsfmt.spec.js.snap rename to tests/variable/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/variable/jsfmt.spec.js b/tests/variable/jsfmt.spec.mjs similarity index 100% rename from tests/variable/jsfmt.spec.js rename to tests/variable/jsfmt.spec.mjs diff --git a/tests/variadic/__snapshots__/jsfmt.spec.js.snap b/tests/variadic/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/variadic/__snapshots__/jsfmt.spec.js.snap rename to tests/variadic/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/variadic/jsfmt.spec.js b/tests/variadic/jsfmt.spec.mjs similarity index 100% rename from tests/variadic/jsfmt.spec.js rename to tests/variadic/jsfmt.spec.mjs diff --git a/tests/while/__snapshots__/jsfmt.spec.js.snap b/tests/while/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/while/__snapshots__/jsfmt.spec.js.snap rename to tests/while/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/while/jsfmt.spec.js b/tests/while/jsfmt.spec.mjs similarity index 100% rename from tests/while/jsfmt.spec.js rename to tests/while/jsfmt.spec.mjs diff --git a/tests/yield/__snapshots__/jsfmt.spec.js.snap b/tests/yield/__snapshots__/jsfmt.spec.mjs.snap similarity index 100% rename from tests/yield/__snapshots__/jsfmt.spec.js.snap rename to tests/yield/__snapshots__/jsfmt.spec.mjs.snap diff --git a/tests/yield/jsfmt.spec.js b/tests/yield/jsfmt.spec.mjs similarity index 100% rename from tests/yield/jsfmt.spec.js rename to tests/yield/jsfmt.spec.mjs diff --git a/tests_config/get_engine.js b/tests_config/get_engine.mjs similarity index 88% rename from tests_config/get_engine.js rename to tests_config/get_engine.mjs index f8ce99bc8..fa85a20f3 100644 --- a/tests_config/get_engine.js +++ b/tests_config/get_engine.mjs @@ -2,7 +2,7 @@ import url from "url"; import { createRequire } from "module"; import prettierModule from "prettier"; import prettierStandalone from "prettier/standalone"; -import * as prettierPluginPhp from "../src/index.js"; +import * as prettierPluginPhp from "../src/index.mjs"; const require = createRequire(import.meta.url); diff --git a/tests_config/run_spec.js b/tests_config/run_spec.mjs similarity index 98% rename from tests_config/run_spec.js rename to tests_config/run_spec.mjs index 4b51da3ef..9abc3c110 100644 --- a/tests_config/run_spec.js +++ b/tests_config/run_spec.mjs @@ -2,7 +2,7 @@ import fs from "fs"; import path from "path"; import url from "url"; import { wrap as raw } from "jest-snapshot-serializer-raw"; -import { prettier, plugin } from "./get_engine.js"; +import { prettier, plugin } from "./get_engine.mjs"; const { AST_COMPARE, TEST_CRLF } = process.env; @@ -29,7 +29,7 @@ global.run_spec = (importMeta, parsers, options) => { path.extname(basename) === ".snap" || !fs.lstatSync(filename).isFile() || basename[0] === "." || - basename === "jsfmt.spec.js" + basename === "jsfmt.spec.mjs" ) { return; }