diff --git a/package.json b/package.json index c4f0971541..7a2a10e9c4 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,7 @@ "eslint-config" ], "exports": { - ".": { - "import": "./dist/index.js", - "require": "./dist/index.cjs" - } + ".": "./dist/index.js" }, "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -25,11 +22,11 @@ "dist" ], "scripts": { - "build": "nr typegen && tsup --format esm,cjs --clean --dts", - "stub": "tsup --format esm", + "build": "nr typegen && tsup --clean --dts", + "stub": "tsup", "dev": "npx @eslint/config-inspector --config eslint.config.ts", "build:inspector": "pnpm build && npx @eslint/config-inspector build", - "watch": "tsup --format esm,cjs --watch", + "watch": "tsup --watch", "lint": "eslint .", "typegen": "tsx scripts/typegen.ts", "prepack": "nr build", diff --git a/test/cli.spec.ts b/test/cli.spec.ts index 466592353d..22dbf62ecc 100644 --- a/test/cli.spec.ts +++ b/test/cli.spec.ts @@ -61,14 +61,6 @@ it('esm eslint.config.js', async () => { expect(stdout).toContain('Created eslint.config.js') }) -it('cjs eslint.config.mjs', async () => { - const { stdout } = await run() - - const eslintConfigContent = await fs.readFile(join(genPath, 'eslint.config.mjs'), 'utf-8') - expect(eslintConfigContent.includes('export default')).toBeTruthy() - expect(stdout).toContain('Created eslint.config.mjs') -}) - it('ignores files added in eslint.config.js', async () => { const { stdout } = await run() diff --git a/tsup.config.ts b/tsup.config.ts index ea075be2c7..4c809a258d 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -6,4 +6,5 @@ export default defineConfig({ 'src/cli.ts', ], shims: true, + format: ['esm'], })