@@ -6,91 +6,91 @@ source: crates/oxc_linter/src/tester.rs
66 1 │ / ^ foo/ .test (bar )
77 · ───────────
88 ╰────
9- help : Replace ` /^foo/.test(bar)` with ` bar.startsWith(" foo" )` .
9+ help : Replace ` /^foo/.test(bar)` with ` bar.startsWith(' foo' )` .
1010
1111 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
1212 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
1313 1 │ / foo$ / .test (bar )
1414 · ───────────
1515 ╰────
16- help : Replace ` /foo$/.test(bar)` with ` bar.endsWith(" foo" )` .
16+ help : Replace ` /foo$/.test(bar)` with ` bar.endsWith(' foo' )` .
1717
1818 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
1919 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
2020 1 │ / \$ $ / .test (bar )
2121 · ──────────
2222 ╰────
23- help : Replace ` /\$ $/.test(bar)` with ` bar.endsWith("$" )` .
23+ help : Replace ` /\$ $/.test(bar)` with ` bar.endsWith('$' )` .
2424
2525 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
2626 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
2727 1 │ / ^ \^ / .test (bar )
2828 · ──────────
2929 ╰────
30- help : Replace ` /^\^ /.test(bar)` with ` bar.startsWith("^" )` .
30+ help : Replace ` /^\^ /.test(bar)` with ` bar.startsWith('^' )` .
3131
3232 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
3333 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
3434 1 │ / ^ !/ .test (bar )
3535 · ─────────
3636 ╰────
37- help : Replace ` /^!/.test(bar)` with ` bar.startsWith("!" )` .
37+ help : Replace ` /^!/.test(bar)` with ` bar.startsWith('!' )` .
3838
3939 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
4040 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
4141 1 │ / !$ / .test (bar )
4242 · ─────────
4343 ╰────
44- help : Replace ` /!$/.test(bar)` with ` bar.endsWith("!" )` .
44+ help : Replace ` /!$/.test(bar)` with ` bar.endsWith('!' )` .
4545
4646 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
4747 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
4848 1 │ / ^ / .test (bar )
4949 · ─────────
5050 ╰────
51- help : Replace ` /^ /.test(bar)` with ` bar.startsWith(" " )` .
51+ help : Replace ` /^ /.test(bar)` with ` bar.startsWith(' ' )` .
5252
5353 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
5454 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
5555 1 │ / $ / .test (bar )
5656 · ─────────
5757 ╰────
58- help : Replace ` / $/.test(bar)` with ` bar.endsWith(" " )` .
58+ help : Replace ` / $/.test(bar)` with ` bar.endsWith(' ' )` .
5959
6060 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
6161 ╭─[prefer_string_starts_ends_with .tsx :1 :17 ]
6262 1 │ const foo = {}; / ^ abc/ .test (foo );
6363 · ───────────
6464 ╰────
65- help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(" abc" )` .
65+ help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(' abc' )` .
6666
6767 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
6868 ╭─[prefer_string_starts_ends_with .tsx :1 :18 ]
6969 1 │ const foo = 123 ; / ^ abc/ .test (foo );
7070 · ───────────
7171 ╰────
72- help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(" abc" )` .
72+ help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(' abc' )` .
7373
7474 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
7575 ╭─[prefer_string_starts_ends_with .tsx :1 :22 ]
7676 1 │ const foo = " hello" ; / ^ abc/ .test (foo );
7777 · ───────────
7878 ╰────
79- help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(" abc" )` .
79+ help : Replace ` /^abc/.test(foo)` with ` foo.startsWith(' abc' )` .
8080
8181 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
8282 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
8383 1 │ / ^ b/ .test ((a ))
8484 · ─────────
8585 ╰────
86- help : Replace ` /^b/.test((a))` with ` a.startsWith("b" )` .
86+ help : Replace ` /^b/.test((a))` with ` a.startsWith('b' )` .
8787
8888 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
8989 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
9090 1 │ (/ ^ b/ ).test ((a ))
9191 · ───────────
9292 ╰────
93- help : Replace ` (/^b/).test((a))` with ` a.startsWith("b" )` .
93+ help : Replace ` (/^b/).test((a))` with ` a.startsWith('b' )` .
9494
9595 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
9696 ╭─[prefer_string_starts_ends_with .tsx :1 :24 ]
@@ -109,7 +109,7 @@ source: crates/oxc_linter/src/tester.rs
109109 1 │ / ^ a/ .test (" string" )
110110 · ─────────
111111 ╰────
112- help : Replace ` /^a/.test("string")` with ` "string".startsWith("a" )` .
112+ help : Replace ` /^a/.test("string")` with ` "string".startsWith('a' )` .
113113
114114 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
115115 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
@@ -176,14 +176,14 @@ source: crates/oxc_linter/src/tester.rs
176176 1 │ / ^ a/ .test (foo .bar )
177177 · ─────────
178178 ╰────
179- help : Replace ` /^a/.test(foo.bar)` with ` foo.bar.startsWith("a" )` .
179+ help : Replace ` /^a/.test(foo.bar)` with ` foo.bar.startsWith('a' )` .
180180
181181 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
182182 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
183183 1 │ / ^ a/ .test (foo .bar ())
184184 · ─────────
185185 ╰────
186- help : Replace ` /^a/.test(foo.bar())` with ` foo.bar().startsWith("a" )` .
186+ help : Replace ` /^a/.test(foo.bar())` with ` foo.bar().startsWith('a' )` .
187187
188188 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
189189 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
@@ -202,7 +202,7 @@ source: crates/oxc_linter/src/tester.rs
202202 1 │ / ^ a/ .test (` string` )
203203 · ─────────
204204 ╰────
205- help : Replace ` /^a/.test(` string ` )` with ` ` string ` .startsWith("a" )` .
205+ help : Replace ` /^a/.test(` string ` )` with ` ` string ` .startsWith('a' )` .
206206
207207 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
208208 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
@@ -245,53 +245,53 @@ source: crates/oxc_linter/src/tester.rs
245245 1 │ / ^ a / u .test (" string" )
246246 · ──────────
247247 ╰────
248- help : Replace ` /^a/u.test("string")` with ` "string".startsWith("a" )` .
248+ help : Replace ` /^a/u.test("string")` with ` "string".startsWith('a' )` .
249249
250250 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
251251 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
252252 1 │ / ^ a / v .test (" string" )
253253 · ──────────
254254 ╰────
255- help : Replace ` /^a/v.test("string")` with ` "string".startsWith("a" )` .
255+ help : Replace ` /^a/v.test("string")` with ` "string".startsWith('a' )` .
256256
257257 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
258258 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
259259 1 │ / a$ / .test (` ${unknown }` )
260260 · ─────────
261261 ╰────
262- help : Replace ` /a$/.test(` $ {unknown }` )` with ` ` $ {unknown }` .endsWith("a" )` .
262+ help : Replace ` /a$/.test(` $ {unknown }` )` with ` ` $ {unknown }` .endsWith('a' )` .
263263
264264 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
265265 ╭─[prefer_string_starts_ends_with .tsx :1 :1 ]
266266 1 │ / a$ / .test (String (unknown ))
267267 · ─────────
268268 ╰────
269- help : Replace ` /a$/.test(String(unknown))` with ` String(unknown).endsWith("a" )` .
269+ help : Replace ` /a$/.test(String(unknown))` with ` String(unknown).endsWith('a' )` .
270270
271271 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
272272 ╭─[prefer_string_starts_ends_with .tsx :1 :11 ]
273273 1 │ const a = / 你$ / .test (' a' );
274274 · ──────────
275275 ╰────
276- help : Replace ` /你$/.test('a')` with ` 'a'.endsWith("你" )` .
276+ help : Replace ` /你$/.test('a')` with ` 'a'.endsWith('你' )` .
277277
278278 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
279279 ╭─[prefer_string_starts_ends_with .tsx :1 :11 ]
280280 1 │ const a = / ^ 你/ .test (' a' );
281281 · ──────────
282282 ╰────
283- help : Replace ` /^你/.test('a')` with ` 'a'.startsWith("你" )` .
283+ help : Replace ` /^你/.test('a')` with ` 'a'.startsWith('你' )` .
284284
285285 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #startsWith over a regex with a caret .
286286 ╭─[prefer_string_starts_ends_with .tsx :1 :5 ]
287287 1 │ if (/ ^ #/ i .test (hex )) {}
288288 · ──────────
289289 ╰────
290- help : Replace ` /^#/i.test(hex)` with ` hex.startsWith("#" )` .
290+ help : Replace ` /^#/i.test(hex)` with ` hex.startsWith('#' )` .
291291
292292 ⚠ eslint - plugin - unicorn (prefer - string - starts - ends - with ): Prefer String #endsWith over a regex with a dollar sign .
293293 ╭─[prefer_string_starts_ends_with .tsx :1 :5 ]
294294 1 │ if (/ #$ / i .test (hex )) {}
295295 · ──────────
296296 ╰────
297- help : Replace ` /#$/i.test(hex)` with ` hex.endsWith("#" )` .
297+ help : Replace ` /#$/i.test(hex)` with ` hex.endsWith('#' )` .
0 commit comments