Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lichenabson opened this issue Nov 7, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@lichenabson
Copy link

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

@lichenabson lichenabson added the 🐞 bug Something isn't working label Nov 7, 2024
@easy1090
Copy link
Collaborator

easy1090 commented Nov 7, 2024

Here have a related mr: #532 . @nyqykk cc~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants