You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The (most welcome) prefer-string-starts-ends-with doesn't consider whether the RegExp it proposes replacing has an i modifier to make it case insensitive.
eslint-plugin-unicorn(prefer-string-starts-ends-with): Prefer String#startsWith over a regex with a caret.
╭─[lib/model/setup.ts:103:1]
103 │ const uri = rec["target-uri"] || "";
104 │ if (/^http/i.test(uri)) {
· ──────────────────
╰────
Arguably it could recommend str.toLowerCase().startsWith() but for long strings it's presumably more efficient to run a case insensitive RegExp on the first few characters rather than down casing the whole string.
Thanks for oxlint - it's awesome.
The text was updated successfully, but these errors were encountered:
…rt more test cases (#1689)
closes#1687 - uses `intersection` instead of `||`:
- this improves performance as it combines the flags into a single bitmask instead of doing two seperate checks
-
Adds missing test cases from eslint-plugin-unicorn
The (most welcome)
prefer-string-starts-ends-with
doesn't consider whether the RegExp it proposes replacing has ani
modifier to make it case insensitive.Arguably it could recommend str.toLowerCase().startsWith() but for long strings it's presumably more efficient to run a case insensitive RegExp on the first few characters rather than down casing the whole string.
Thanks for oxlint - it's awesome.
The text was updated successfully, but these errors were encountered: