-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
refactor(migrate/eslint): improve naming-convention migration #2968
Conversation
cc8cb2f
to
b2c3ed5
Compare
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
crates/biome_js_analyze/tests/specs/style/useNamingConvention/malformedSelector.js.snap
Outdated
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #2968 will improve performances by 6.49%Comparing Summary
Benchmarks breakdown
|
b2c3ed5
to
16d9a31
Compare
Personally, I don't think we should provide a migration path to this rule, because regex coming from eslint are JavaScript regex, and we use a crate that doesn't support JavaScript regex. While this is a best effort work, users should be aware of possible discrepancies. Personally, it's not worth the trouble, but maybe I'm wrong. I hope I am. I wished you had discussed this before, but the work is done now. If you think it's worth the trouble, please make sure that everything is documented on the website, so we set clear expectations. |
It was a bullet point in my task list in #2770
Yes, however restricted regex should reject regexes that e don't support. Maybe you are right. This PR already took me too much time. Especially because of the stack overflow. |
953178a
to
4b206ec
Compare
I removed the attempt of translating JavaScript regexes into Rust regexes. |
Summary
This PR improves the migration of the
naming-convention
rule.It attempts to migrate to the new
conventions
option ofuseNamingConvention
.Unfortunately I encounter stack overflow when I am trying to create regexes.
Thus, I commented all codes that compile a regex.
This makes the migration greatly less useful.
I am open to suggestions to solve this issue.
I also fixed a bug in
RestrictedRegex
that ruled out([^x])
.Test Plan
I extended a test.