Skip to content

Commit 1d9d8d6

Browse files
committed
fix(eslint-config-turbo): use module.exports for ESLint v8 compatibility
Fixes #10901 In PR #10794, we changed from module.exports to export default, which caused bunchee to generate exports.default = config instead of module.exports = config in the CommonJS build. ESLint v8 with legacy .eslintrc.* configuration expects shareable configs to export directly via module.exports. When it encounters exports.default, it interprets 'default' as an unexpected top-level configuration property, resulting in the error: 'Unexpected top-level property "default"' This fix reverts to module.exports for the main entry point to restore ESLint v8 compatibility, while maintaining ESLint v9 flat config support through the ./flat export path. Testing: - Verified publint --strict passes - Verified attw type checking passes - Confirmed compiled output uses module.exports - Both CJS require() and ESM import() work correctly
1 parent bd822ca commit 1d9d8d6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

packages/eslint-config-turbo/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
],
3333
"main": "./dist/cjs/index.js",
3434
"types": "./dist/cjs/index.d.ts",
35-
"module": "./dist/es/index.mjs",
3635
"exports": {
3736
"./flat": {
3837
"import": {
@@ -46,8 +45,8 @@
4645
},
4746
".": {
4847
"import": {
49-
"types": "./dist/es/index.d.mts",
50-
"default": "./dist/es/index.mjs"
48+
"types": "./dist/cjs/index.d.ts",
49+
"default": "./dist/cjs/index.js"
5150
},
5251
"require": {
5352
"types": "./dist/cjs/index.d.ts",

packages/eslint-config-turbo/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ const config = {
22
extends: ["plugin:turbo/recommended"],
33
};
44

5-
// eslint-disable-next-line import/no-default-export -- ESLint convention is a default export
6-
export default config;
5+
module.exports = config;

0 commit comments

Comments
 (0)