Skip to content

Commit

Permalink
chore: fix minor typos in patterns (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Apr 13, 2024
1 parent f053442 commit be6d9b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .grit/patterns/js/curly.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (x > 0) {
}
```

##else
## else
```js
if (x > 0)
doStuff();
Expand Down
2 changes: 1 addition & 1 deletion .grit/patterns/js/replaceAll_to_replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Rewrite `replaceAll` ⇒ `replace` when have regex pattern
tags: [fix]
---

Replaces `replaceAll` with `replace`, when have regex pattern.
Replaces `replaceAll` with `replace`, when it uses a regex pattern.

The `replaceAll` string method may not be supported in all JavaScript versions and older browsers. It is advisable to use the `replace()` method with a regular expression as the first argument. For example, use `mystring.replace(/bad/g, "good") `instead of `mystring.replaceAll("bad", "good")`

Expand Down
2 changes: 1 addition & 1 deletion .grit/patterns/js/useless_ternary_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Find useless ternary operator
tags: [fix]
---

If $condition ? `$answer`:`$answer` then this expression returns $answer. This is probably a human error
If $condition ? `$answer`:`$answer` then this expression returns $answer. This is probably a human error.


```grit
Expand Down

0 comments on commit be6d9b0

Please sign in to comment.