Skip to content

[Bug]: sourceFileName vs. sourceFilename scattered differently over project, sometimes typed wrong #13170

@wooorm

Description

@wooorm

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

n/a

Configuration file name

No response

Configuration

n/a

Current and expected behavior

  function myFancyBabelPlugin() {
    return {
      parserOverride(contents, options) {
        if (
          options.sourceFileName &&

^-- type error “Did you mean 'sourceFilename'”, but sourceFilename is undefined and sourceFileName is set.
A bit of searching shows differently cased values: https://github.com/babel/babel/search?q=sourceFilename+path%3Apackages.

Environment

$ npx envinfo --preset
Need to install the following packages:
  envinfo
Ok to proceed? (y) y

No "true" preset found.

Possible solution

picking either

Additional context

Actual code is here: https://github.com/wooorm/xdm/blob/main/test/babel.js#L37-L41.

Metadata

Metadata

Assignees

Labels

outdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: cli

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions