Skip to content

Bug: CJS config does not complain about no config object (while ESM config does) #19044

Closed
@abrahamguo

Description

@abrahamguo

Environment

Local ESLint version: 9.13.0

What parser are you using?

Default (Espree)

What did you do?

No "type" declared inside package.json.

Three blank config files:

  • eslint.config.cjs
  • eslint.config.js
  • eslint.config.mjs

What did you expect to happen?

ESLint should give the same output no matter which of the three blank config files are used.

What actually happened?

  • npx eslint -c eslint.config.cjs: no output
  • npx eslint -c eslint.config.js: no output
  • npx eslint -c eslint.config.mjs: the following error message was displayed:
Oops! Something went wrong! :(

ESLint: 9.13.0

TypeError: Config (unnamed): Unexpected undefined config at user-defined index 0.

Link to Minimal Reproducible Example

https://github.com/abrahamguo/repro/tree/eslint-no-export

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlyrepro:yesIssues with a reproducible example

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy