File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff 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);
229230const 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
234249MIT
You can’t perform that action at this time.
0 commit comments