8000 feat!: drop CJS build · antfu/eslint-config@216fa10 · GitHub
[go: up one dir, main page]

Skip to content

Commit 216fa10

Browse files
committed
feat!: drop CJS build
If you are still doing `require('@antfu/eslint-config')`, change your config name to end with `.mjs` and migrate to import.
1 parent e680a95 commit 216fa10

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
"eslint-config"
1313
],
1414
"exports": {
15-
".": {
16-
"import": "./dist/index.js",
17-
"require": "./dist/index.cjs"
18-
}
15+
".": "./dist/index.js"
1916
},
2017
"main": "./dist/index.js",
2118
"types": "./dist/index.d.ts",
@@ -25,11 +22,11 @@
2522
"dist"
2623
],
2724
"scripts": {
28-
"build": "nr typegen && tsup --format esm,cjs --clean --dts",
29-
"stub": "tsup --format esm",
25+
"build": "nr typegen && tsup --clean --dts",
26+
"stub": "tsup",
3027
"dev": "npx @eslint/config-inspector --config eslint.config.ts",
3128
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
32-
"watch": "tsup --format esm,cjs --watch",
29+
"watch": "tsup --watch",
3330
"lint": "eslint .",
3431
"typegen": "tsx scripts/typegen.ts",
3532
"prepack": "nr build",

test/cli.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ it('esm eslint.config.js', async () => {
6161
expect(stdout).toContain('Created eslint.config.js')
6262
})
6363

64-
it('cjs eslint.config.mjs', async () => {
65-
const { stdout } = await run()
66-
67-
const eslintConfigContent = await fs.readFile(join(genPath, 'eslint.config.mjs'), 'utf-8')
68-
expect(eslintConfigContent.includes('export default')).toBeTruthy()
69-
expect(stdout).toContain('Created eslint.config.mjs')
70-
})
71-
7264
it('ignores files added in eslint.config.js', async () => {
7365
const { stdout } = await run()
7466

tsup.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export default defineConfig({
66
'src/cli.ts',
77
],
88
shims: true,
9+
format: ['esm'],
910
})

0 commit comments

Comments
 (0)
0