Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 6b2aabd

Browse files
feat(rule): add no-misleading-character-class (error)
1 parent 20155f1 commit 6b2aabd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

environments/shared/recommended.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ module.exports = {
215215
// could also indicate a misunderstanding of how the language works.
216216
'no-loop-func': 'warn',
217217

218+
// Disallow characters which are made with multiple code points in character class syntax
219+
// Unicode includes characters which are made with multiple code points. RegExp character class
220+
// syntax (/[abc]/) cannot handle characters which are made by multiple code points as a
221+
// character; those characters will be dissolved to each code point. For example, ❇️ is made by
222+
// ❇ (U+2747) and VARIATION SELECTOR-16 (U+FE0F). If this character is in RegExp character
223+
// class, it will match to either ❇ (U+2747) or VARIATION SELECTOR-16 (U+FE0F) rather than ❇️.
224+
'no-misleading-character-class': 'error',
225+
218226
// Disallow certain object properties
219227
// Currently configured for the following (more can be added as necessary):
220228
// - Mocha test isolation features (skipping tests, running only certain tests)

0 commit comments

Comments
 (0)