这是indexloc提供的服务,不要输入任何密码
Skip to content

Unexpected top-level property "default" after updating eslint-config-turbo to 2.5.8 #10901

@breadadams

Description

@breadadams

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/breadadams/turborepo-eslint-config-unexpected-top-level-default

Which canary version will you have in your reproduction?

2.5.8

Environment information

CLI:
   Version: 2.5.8
   Path to executable: /Users/.../turbo-eslint-toplevel-default-bug/node_modules/turbo-darwin-64/bin/turbo
   Daemon status: Running
   Package manager: npm

Platform:
   Architecture: x86_64
   Operating system: macos
   WSL: false
   Available memory (MB): 4944
   Available CPU cores: 16

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): iTerm.app
   Terminal program version (TERM_PROGRAM_VERSION): 3.5.11
   Shell (SHELL): /bin/zsh
   stdin: false

Expected behavior

Should be compatible with ESLint v8.x

Actual behavior

Throws the following error:

tooling-config:lint: Oops! Something went wrong! :(
tooling-config:lint:
tooling-config:lint: ESLint: 8.57.1
tooling-config:lint:
tooling-config:lint: Error: ESLint configuration in .eslintrc.js » eslint-config-turbo is invalid:
tooling-config:lint: 	- Unexpected top-level property "default".

To Reproduce

Run turbo lint --filter tooling-config in the repro

Additional context

I believe the issue was introduced here in #10794, where module.exports was replaced with export default

// eslint-disable-next-line import/no-default-export -- ESLint convention is a default export
export default config;

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions