From a2fa6e94b8b1c74b47074222854d5bd6777d4121 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Fri, 21 Nov 2025 12:55:18 +0100 Subject: [PATCH] Use `.mjs` for ember-template-lint and Prettier config files --- files/{.prettierrc.cjs => .prettierrc.mjs} | 4 +--- files/{.template-lintrc.cjs => .template-lintrc.mjs} | 4 +--- tests/fixtures/default/{.prettierrc.cjs => .prettierrc.mjs} | 4 +--- tests/helpers/assertions.ts | 2 +- tests/smoke-tests/--addon-only.test.ts | 4 ++-- .../within-existing-monorepo/custom-locations.test.ts | 2 +- tests/smoke-tests/within-existing-monorepo/defaults.test.ts | 2 +- 7 files changed, 8 insertions(+), 14 deletions(-) rename files/{.prettierrc.cjs => .prettierrc.mjs} (86%) rename files/{.template-lintrc.cjs => .template-lintrc.mjs} (65%) rename tests/fixtures/default/{.prettierrc.cjs => .prettierrc.mjs} (86%) diff --git a/files/.prettierrc.cjs b/files/.prettierrc.mjs similarity index 86% rename from files/.prettierrc.cjs rename to files/.prettierrc.mjs index 8e62a45..9cc6b3d 100644 --- a/files/.prettierrc.cjs +++ b/files/.prettierrc.mjs @@ -1,6 +1,4 @@ -'use strict'; - -module.exports = { +export default { plugins: ['prettier-plugin-ember-template-tag'], overrides: [ { diff --git a/files/.template-lintrc.cjs b/files/.template-lintrc.mjs similarity index 65% rename from files/.template-lintrc.cjs rename to files/.template-lintrc.mjs index 2fedce2..8b6625c 100644 --- a/files/.template-lintrc.cjs +++ b/files/.template-lintrc.mjs @@ -1,6 +1,4 @@ -'use strict'; - -module.exports = { +export default { extends: 'recommended', checkHbsTemplateLiterals: false, }; diff --git a/tests/fixtures/default/.prettierrc.cjs b/tests/fixtures/default/.prettierrc.mjs similarity index 86% rename from tests/fixtures/default/.prettierrc.cjs rename to tests/fixtures/default/.prettierrc.mjs index 8e62a45..9cc6b3d 100644 --- a/tests/fixtures/default/.prettierrc.cjs +++ b/tests/fixtures/default/.prettierrc.mjs @@ -1,6 +1,4 @@ -'use strict'; - -module.exports = { +export default { plugins: ['prettier-plugin-ember-template-tag'], overrides: [ { diff --git a/tests/helpers/assertions.ts b/tests/helpers/assertions.ts index a970a29..70d4ccc 100644 --- a/tests/helpers/assertions.ts +++ b/tests/helpers/assertions.ts @@ -47,7 +47,7 @@ export async function assertGeneratedCorrectly({ } if (!existingMonorepo) { - await matchesFixture('.prettierrc.cjs', { cwd: projectRoot }); + await matchesFixture('.prettierrc.mjs', { cwd: projectRoot }); await assertCorrectECUJson({ projectRoot, diff --git a/tests/smoke-tests/--addon-only.test.ts b/tests/smoke-tests/--addon-only.test.ts index 6fadc2d..878edcf 100644 --- a/tests/smoke-tests/--addon-only.test.ts +++ b/tests/smoke-tests/--addon-only.test.ts @@ -30,8 +30,8 @@ describe.skip('--addon-only', () => { expect(rootContents).to.include('.gitignore'); expect(rootContents).to.include('pnpm-workspace.yaml'); expect(rootContents).to.include('.prettierignore'); - expect(rootContents).to.include('.prettierrc.cjs'); - expect(rootContents).to.include('.template-lintrc.cjs'); + expect(rootContents).to.include('.prettierrc.mjs'); + expect(rootContents).to.include('.template-lintrc.mjs'); expect(rootContents).to.include('CONTRIBUTING.md'); expect(rootContents).to.include('LICENSE.md'); expect(rootContents).to.include('README.md'); diff --git a/tests/smoke-tests/within-existing-monorepo/custom-locations.test.ts b/tests/smoke-tests/within-existing-monorepo/custom-locations.test.ts index 8cbc37b..56e1251 100644 --- a/tests/smoke-tests/within-existing-monorepo/custom-locations.test.ts +++ b/tests/smoke-tests/within-existing-monorepo/custom-locations.test.ts @@ -14,7 +14,7 @@ import { } from '../../helpers.js'; let commonFixtures = { - '.prettierrc.cjs': await readFixture('.prettierrc.cjs'), + '.prettierrc.mjs': await readFixture('.prettierrc.mjs'), }; describe.skip('custom locations', () => { diff --git a/tests/smoke-tests/within-existing-monorepo/defaults.test.ts b/tests/smoke-tests/within-existing-monorepo/defaults.test.ts index fdb3d3b..0c332a2 100644 --- a/tests/smoke-tests/within-existing-monorepo/defaults.test.ts +++ b/tests/smoke-tests/within-existing-monorepo/defaults.test.ts @@ -15,7 +15,7 @@ import { } from '../../helpers.js'; let commonFixtures = { - '.prettierrc.cjs': await readFixture('.prettierrc.cjs'), + '.prettierrc.mjs': await readFixture('.prettierrc.mjs'), }; for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {