Skip to content

Commit

Permalink
update dependencies, improve linting
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Apr 14, 2021
1 parent 381a25c commit ce52fdc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ const base = {
'radar/prefer-while': 'error',

// regexp
// disallow confusing quantifiers
'regexp/confusing-quantifier': 'error',
// enforce into your favorite case
'regexp/letter-case': ['error', {
caseInsensitive: 'lowercase',
Expand All @@ -448,6 +450,8 @@ const base = {
'regexp/no-dupe-characters-character-class': 'error',
// disallow duplicate disjunctions
'regexp/no-dupe-disjunctions': 'error',
// disallow alternatives without elements
'regexp/no-empty-alternative': 'error',
// disallow empty group
'regexp/no-empty-group': 'error',
// disallow empty lookahead assertion or empty lookbehind assertion
Expand All @@ -456,6 +460,8 @@ const base = {
'regexp/no-escape-backspace': 'error',
// disallow invisible raw character
'regexp/no-invisible-character': 'error',
// disallow lazy quantifiers at the end of an expression
'regexp/no-lazy-ends': 'error',
// disallow legacy RegExp features
'regexp/no-legacy-features': 'error',
// disallow octal escape sequence
Expand All @@ -480,6 +486,8 @@ const base = {
'regexp/no-useless-range': 'error',
// disallow unnecessary `{n,m}`` quantifier
'regexp/no-useless-two-nums-quantifier': 'error',
// disallow the alternatives of lookarounds that end with a non-constant quantifier
'regexp/optimal-lookaround-quantifier': 'error',
// enforces elements order in character class
'regexp/order-in-character-class': 'error',
// enforce using character class
Expand Down Expand Up @@ -893,6 +901,7 @@ module.exports = {
},
{
files: [
'tests/compat/**',
'tests/helpers/**',
'tests/observables/**',
'tests/promises-aplus/**',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-qunit": "^6.0.0",
"eslint-plugin-radar": "~0.2.1",
"eslint-plugin-regexp": "~0.7.5",
"eslint-plugin-regexp": "~0.8.0",
"eslint-plugin-unicorn": "^29.0.0",
"karma": "^6.3.2",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -56,7 +56,7 @@
"qunit": "^2.15.0",
"semver": "^7.3.5",
"terser": "^5.6.1",
"webpack": "^5.32.0",
"webpack": "^5.33.0",
"webpack-cli": "^4.6.0"
},
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"chalk": "^4.1.0",
"detective": "^5.2.0",
"electron-to-chromium": "^1.3.713",
"electron-to-chromium": "^1.3.717",
"glob": "^7.1.6"
},
"funding": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/regexp-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;

// nonparticipating capturing group, copied from es5-shim's String#split patch.
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;

var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
Expand Down
5 changes: 2 additions & 3 deletions tests/compat/tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-new, radix -- required for testing */
// eslint-disable-next-line no-new-func -- safe
/* eslint-disable radix -- required for testing */
var GLOBAL = Function('return this')();
var WHITESPACES = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
Expand Down Expand Up @@ -764,7 +763,7 @@ GLOBAL.tests = {
re1.exec('a');
re2.exec('a');
return re1.lastIndex === 0 && re2.lastIndex === 0
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
// eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- required for testing
&& /()??/.exec('')[1] === undefined
&& reSticky.exec('abc')[0] === 'a'
&& reSticky.exec('abc') === null
Expand Down
1 change: 1 addition & 0 deletions tests/tests/es.string.split.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable regexp/no-empty-group, regexp/no-assertion-capturing-group -- required for testing */
/* eslint-disable regexp/optimal-lookaround-quantifier, regexp/no-lazy-ends -- required for testing */
import { GLOBAL, NATIVE, STRICT } from '../helpers/constants';
import { patchRegExp$exec } from '../helpers/helpers';

Expand Down

0 comments on commit ce52fdc

Please sign in to comment.