Skip to content

Commit e9c1998

Browse files
committed
docs: @putout/plugin-regexp: remove-duplicates-from-character-class
1 parent 487ac59 commit e9c1998

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

packages/plugin-regexp/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ npm i @putout/plugin-regexp -D
2727
-[optimize](#optimize);
2828
-[remove-useless-group](#remove-useless-group);
2929
-[remove-useless-regexp](#remove-useless-regexp);
30-
-[types.js](#types.js);
30+
-[remove-duplicates-from-character-class](#remove-duplicates-from-character-class);
3131

3232
## Config
3333

@@ -43,7 +43,8 @@ npm i @putout/plugin-regexp -D
4343
"regexp/convert-to-string": "on",
4444
"regexp/convert-replace-to-replace-all": "on",
4545
"regexp/remove-useless-group": "on",
46-
"regexp/remove-useless-regexp": "on"
46+
"regexp/remove-useless-regexp": "on",
47+
"regexp/remove-duplicates-from-character-class": "on"
4748
}
4849
}
4950
```
@@ -229,6 +230,20 @@ const a = /^\.hello$/.test(str);
229230
const a = str === '.hello';
230231
```
231232

233+
## remove-duplicates-from-character-class
234+
235+
### ❌ Example of incorrect code
236+
237+
```js
238+
/[aaabb]/.test(str);
239+
```
240+
241+
### ✅ Example of correct code
242+
243+
```js
244+
/[ab]/.test(str);
245+
```
246+
232247
## License
233248

234249
MIT

0 commit comments

Comments
 (0)