Skip to content

babel/packages/babel-parser/typings/babel-parser.d.ts lacks some plugins #10186

@hybloid

Description

@hybloid

Bug Report

Current Behavior
Currently, TS definition for ParserPlugin type (definded inbabel/packages/babel-parser/typings/babel-parser.d.ts) misses the plugins placeholders, partialApplication, logicalAssignment which could be enabled and used with the parser.

Current workaround is to specify alongside with the first plugin name to make tsc compiler work;

Input Code

const options: ParserOptions = {
    sourceType: 'unambiguous',
    strictMode: false,
    plugins: [
        <any>'placeholders',
        'logicalAssignment',
        'partialApplication',
   ],
};

Expected behavior/code
I expect definition to be modified allowing specify ParserOptions without

const options: ParserOptions = {
    sourceType: 'unambiguous',
    strictMode: false,
    plugins: [
        'placeholders',
        'logicalAssignment',
        'partialApplication',
   ],
};

Environment

  • Babel version(s): 7.5.0
  • Node/npm version: 10.16.0
  • OS: Ubuntu
  • How you are using Babel: npm package

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueoutdatedA 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