Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 9b33bb8

Browse files
committed
Update ESLint and plugins
1 parent f199d0f commit 9b33bb8

File tree

4 files changed

+2129
-782
lines changed

4 files changed

+2129
-782
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"plugins": ["jest", "@typescript-eslint"],
3-
"extends": ["plugin:github/typescript"],
3+
"extends": ["plugin:github/recommended"],
44
"parser": "@typescript-eslint/parser",
55
"parserOptions": {
66
"ecmaVersion": 9,
@@ -10,7 +10,9 @@
1010
"rules": {
1111
"eslint-comments/no-use": "off",
1212
"import/no-namespace": "off",
13+
"i18n-text/no-en": "off",
1314
"no-unused-vars": "off",
15+
"sort-imports": "off",
1416
"@typescript-eslint/no-unused-vars": "error",
1517
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
1618
"@typescript-eslint/no-require-imports": "error",

dist/index.js

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,6 +2289,8 @@ var INTRINSICS = {
22892289
'%AsyncIteratorPrototype%': needsEval,
22902290
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
22912291
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
2292+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
2293+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
22922294
'%Boolean%': Boolean,
22932295
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
22942296
'%Date%': Date,
@@ -2344,6 +2346,14 @@ var INTRINSICS = {
23442346
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
23452347
};
23462348

2349+
try {
2350+
null.error; // eslint-disable-line no-unused-expressions
2351+
} catch (e) {
2352+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
2353+
var errorProto = getProto(getProto(e));
2354+
INTRINSICS['%Error.prototype%'] = errorProto;
2355+
}
2356+
23472357
var doEval = function doEval(name) {
23482358
var value;
23492359
if (name === '%AsyncFunction%') {
@@ -2429,6 +2439,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat);
24292439
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
24302440
var $replace = bind.call(Function.call, String.prototype.replace);
24312441
var $strSlice = bind.call(Function.call, String.prototype.slice);
2442+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
24322443

24332444
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
24342445
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
@@ -2484,6 +2495,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
24842495
throw new $TypeError('"allowMissing" argument must be a boolean');
24852496
}
24862497

2498+
if ($exec(/^%?[^%]*%?$/, name) === null) {
2499+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
2500+
}
24872501
var parts = stringToPath(name);
24882502
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
24892503

@@ -2713,8 +2727,9 @@ function addNumericSeparator(num, str) {
27132727
return $replace.call(str, sepRegex, '$&_');
27142728
}
27152729

2716-
var inspectCustom = __nccwpck_require__(7265).custom;
2717-
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
2730+
var utilInspect = __nccwpck_require__(7265);
2731+
var inspectCustom = utilInspect.custom;
2732+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
27182733

27192734
module.exports = function inspect_(obj, options, depth, seen) {
27202735
var opts = options || {};
@@ -2804,7 +2819,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
28042819
return inspect_(value, opts, depth + 1, seen);
28052820
}
28062821

2807-
if (typeof obj === 'function') {
2822+
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
28082823
var name = nameOf(obj);
28092824
var keys = arrObjKeys(obj, inspect);
28102825
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
@@ -2834,31 +2849,35 @@ module.exports = function inspect_(obj, options, depth, seen) {
28342849
}
28352850
if (isError(obj)) {
28362851
var parts = arrObjKeys(obj, inspect);
2837-
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
2852+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
28382853
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
28392854
}
28402855
if (parts.length === 0) { return '[' + String(obj) + ']'; }
28412856
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
28422857
}
28432858
if (typeof obj === 'object' && customInspect) {
2844-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
2845-
return obj[inspectSymbol]();
2859+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
2860+
return utilInspect(obj, { depth: maxDepth - depth });
28462861
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
28472862
return obj.inspect();
28482863
}
28492864
}
28502865
if (isMap(obj)) {
28512866
var mapParts = [];
2852-
mapForEach.call(obj, function (value, key) {
2853-
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
2854-
});
2867+
if (mapForEach) {
2868+
mapForEach.call(obj, function (value, key) {
2869+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
2870+
});
2871+
}
28552872
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
28562873
}
28572874
if (isSet(obj)) {
28582875
var setParts = [];
2859-
setForEach.call(obj, function (value) {
2860-
setParts.push(inspect(value, obj));
2861-
});
2876+
if (setForEach) {
2877+
setForEach.call(obj, function (value) {
2878+
setParts.push(inspect(value, obj));
2879+
});
2880+
}
28622881
return collectionOf('Set', setSize.call(obj), setParts, indent);
28632882
}
28642883
if (isWeakMap(obj)) {

0 commit comments

Comments
 (0)