-
-
Notifications
You must be signed in to change notification settings - Fork 720
test(linter/no-console): add more tests #11878
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
test(linter/no-console): add more tests #11878
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #11878 will improve performances by 19.62%Comparing Summary
Benchmarks breakdown
|
Merge activity
|
Add a few tests to `no-console` rule, to make sure it catches e.g. `console['log'](foo)`. The test for `console[`lo\\x67`](foo)` ensures the correct operation of `ComputedMemberExpression::static_property_name` - that it uses `cooked` not `raw` for `TemplateLiteral`s.
887d15a to
a1a7b50
Compare
|
Actually this doesn't test what I wanted it to. No matter how the string is interpreted (cooked or raw), it'll still be a fail. |
you can customize the allowed console console methods via config? does that get what you're looking for? oxc/crates/oxc_linter/src/rules/eslint/no_console.rs Lines 228 to 232 in 3d88eeb
|
a1a7b50 to
3e1d6cf
Compare
|
I think fixed now. This test fails if switch to using |
Add a few tests to `no-console` rule, to make sure it catches e.g. `console['log'](foo)`. The test for ``console[`lo\\x67`](foo)`` ensures the correct operation of `ComputedMemberExpression::static_property_name` - that it uses `cooked` not `raw` for `TemplateLiteral`s.
3e1d6cf to
168f776
Compare
Instead of iterating over `allow` and recalculating the static property name on each turn of the loop, check if the property name is allowed once it's already calculated with `MemberExpression::static_property_info`. This PR also ensures that the fix made in #11879 works. If not stacked on top of that PR, one of the tests added in #11878 fails.

Add a few tests to
no-consolerule, to make sure it catches e.g.console['log'](foo).The test for
console[`lo\\x67`](foo)ensures the correct operation ofComputedMemberExpression::static_property_name- that it usescookednotrawforTemplateLiterals.