Skip to content

[Bug]: ECMA-VERSION-CHECK behavior inconsistent with .browserslistrc settings #584

Open

Description

Version

System: macos
browsers: chrome126
npmPackages: 0.4.8

Details

I've encountered an issue with the ECMA-VERSION-CHECK feature in Rsbuild. It appears that this check may not be respecting the settings in the .browserslistrc file as expected. Here are my observations:

Under default settings, regardless of how I modify the .browserslistrc file, ECMA-VERSION-CHECK consistently enforces ES5 standards. It produces warnings like: "The ECMA version used in "XXX.js" is ES7+, which exceeds the ES5 standard."

The issue is resolved when I explicitly set the configuration as follows:

'ecma-version-check': ['Error', { highestVersion: 'ES7+', ignore: [] }],
This raises two questions:

Does ECMA-VERSION-CHECK actually follow the settings in .browserslistrc? If so, why doesn't it seem to be reflecting changes made to this file?

Why are the highestVersion and ignore options not documented, despite being functional? It would be helpful to have these options clearly explained in the documentation.

I would appreciate any clarification on these points. If this is indeed a bug, it would be beneficial to align ECMA-VERSION-CHECK with the .browserslistrc settings for more consistent and predictable behavior.

Thank you for your attention to this matter.

Reproduce link

https://github.com/lichenabson/rsbuild-project/tree/rsdoctor

Reproduce Steps

pnpm run build:rsdoctor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions