Skip to content

[Bug]: Incorrect SourceLocation typings  #15775

@bricejar

Description

@bricejar

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

In babel types I have

interface SourceLocation {
    start: {
        line: number;
        column: number;
    };
    end: {
        line: number;
        column: number;
    };
}

It appears that is is missing the property index for start and end. The correct type should be

interface SourceLocation {
    start: {
        line: number;
        column: number;
        index: number;
    };
    end: {
        line: number;
        column: number;
        index: number;
    };
}

Configuration file name

No response

Configuration

No response

Current and expected behavior

In babel types I have

interface SourceLocation {
    start: {
        line: number;
        column: number;
    };
    end: {
        line: number;
        column: number;
    };
}

It appears that is is missing the property index for start and end. The correct type should be

interface SourceLocation {
    start: {
        line: number;
        column: number;
        index: number;
    };
    end: {
        line: number;
        column: number;
        index: number;
    };
}

Environment

  Binaries:
    Node: 18.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    @babel/core: ^7.22.8 => 7.22.8
    @babel/eslint-parser: ^7.22.7 => 7.22.7
    @babel/preset-env: ^7.22.7 => 7.22.7
    @babel/preset-react: ^7.22.5 => 7.22.5
    @babel/preset-typescript: ^7.22.5 => 7.22.5
    babel-loader: ^8.3.0 => 8.3.0
    babel-plugin-styled-components: ^2.0.7 => 2.0.7
    eslint: ^8.37.0 => 8.37.0
    jest: ^29.5.0 => 29.5.0
    webpack: ^5.76.3 => 5.76.3

Possible solution

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions