Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: use bundled dts for register and eslint-*#17993

Merged
JLHwung merged 3 commits into
babel:mainfrom
JLHwung:bundle-dts
May 21, 2026
Merged

chore: use bundled dts for register and eslint-*#17993
JLHwung merged 3 commits into
babel:mainfrom
JLHwung:bundle-dts

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented May 11, 2026

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

In this PR we use bundled dts for @babel/register and @babel/eslint-*. We also cleaned up the yarn constraints config.

@JLHwung JLHwung added the PR: Internal 🏠 A type of pull request used for our changelog categories label May 11, 2026
"./overlapping-plugins": "./data/overlapping-plugins.json",
"./plugin-bugfixes": "./data/plugin-bugfixes.json"
"./plugin-bugfixes": "./data/plugin-bugfixes.json",
"./package.json": "./package.json"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is caught by the new rule: Enforce ./package.json export for all public packages.

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented May 11, 2026

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/61582

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

commit: fd70fba

@JLHwung JLHwung requested a review from liuxingbaoyu May 16, 2026 23:28
Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually checked the generated type files, and they don't look as good as before. Let's align them.

Such as

declare const meta: {
    name: string;
    version: string;
};
declare function parse(code: string, options?: {}): any;
declare function parseForESLint(code: string, options?: {}): {
    ast: any;
    scopeManager: any;
    visitorKeys: Record<string, string[]>;
};
declare const _default: {
    meta: {
        name: string;
        version: string;
    };
    parse: typeof parse;
    parseForESLint: typeof parseForESLint;
};

export { _default as default, meta, parse, parseForESLint };

@JLHwung
Copy link
Copy Markdown
Contributor Author

JLHwung commented May 20, 2026

I manually checked the generated type files, and they don't look as good as before. Let's align them.

Such as

declare const meta: {
    name: string;
    version: string;
};
declare function parse(code: string, options?: {}): any;
declare function parseForESLint(code: string, options?: {}): {
    ast: any;
    scopeManager: any;
    visitorKeys: Record<string, string[]>;
};
declare const _default: {
    meta: {
        name: string;
        version: string;
    };
    parse: typeof parse;
    parseForESLint: typeof parseForESLint;
};

export { _default as default, meta, parse, parseForESLint };

Good catch, here is the updated generated typings:

import { Linter, AST, ESLint } from 'eslint';

declare const meta: ESLint.ObjectMetaProperties["meta"];
declare function parse(code: string, options?: Linter.ParserOptions): AST.Program;
declare function parseForESLint(code: string, options?: Linter.ParserOptions): Linter.ESLintParseResult;
declare const _default: {
    meta: {
        name?: string | undefined;
        version?: string | undefined;
    };
    parse: typeof parse;
    parseForESLint: typeof parseForESLint;
};

export { _default as default, meta, parse, parseForESLint };

Does it look good to you?

Copy link
Copy Markdown
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@JLHwung JLHwung merged commit cedb08b into babel:main May 21, 2026
57 checks passed
@JLHwung JLHwung deleted the bundle-dts branch May 21, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants