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

Commit

Permalink
feat(rule): add require-unicode-regexp (warn)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Aug 15, 2018
1 parent 2bb65c2 commit d8b96fd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions environments/shared/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,17 @@ module.exports = {
// refactoring.
'require-await': 'warn',

// Enforce the use of u flag on RegExp
// RegExp u flag has two effects:
// - Make the regular expression handling UTF-16 surrogate pairs correctly
// - Make the regular expression throw syntax errors early by disabling Annex B extensions
//
// The u flag disables the recovering logic Annex B defined. As a result, you can find errors
// early. This is similar to the strict mode. Therefore, the u flag lets us work better with
// regular expressions.
// @TODO (semver-major): Raise to `error`
'require-unicode-regexp': 'warn',

// Disallow generator functions that do not have yield
'require-yield': 'error',

Expand Down

0 comments on commit d8b96fd

Please sign in to comment.