Skip to content

Commit

Permalink
tools: update eslint
Browse files Browse the repository at this point in the history
This updates eslint from v6.0.0-alpha.2 to v6.0.1

This also removes eslint-disable comments about `bigint` typeof
checks. Those would otherwise have caused linting errors now that
`bigint` is accepted as valid entry.

PR-URL: #28173
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
  • Loading branch information
BridgeAR authored and targos committed Jul 2, 2019
1 parent 3c047b3 commit b744bd9
Show file tree
Hide file tree
Showing 63 changed files with 1,963 additions and 396 deletions.
1 change: 0 additions & 1 deletion benchmark/process/bench-hrtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ function main({ n, type }) {
break;
}

// eslint-disable-next-line valid-typeof
assert.ok(Array.isArray(noDead) || typeof noDead === 'bigint');
}
1 change: 0 additions & 1 deletion lib/internal/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function checkBounds(buf, offset, byteLength) {

function checkInt(value, min, max, buf, offset, byteLength) {
if (value > max || value < min) {
// eslint-disable-next-line valid-typeof
const n = typeof min === 'bigint' ? 'n' : '';
let range;
if (byteLength > 3) {
Expand Down
1 change: 0 additions & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ E('ERR_OUT_OF_RANGE',
let received;
if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
received = addNumericalSeparator(String(input));
// eslint-disable-next-line valid-typeof
} else if (typeof input === 'bigint') {
received = String(input);
if (input > 2n ** 32n || input < -(2n ** 32n)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/fs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Stats.prototype._checkModeProperty = function(property) {
property === S_IFSOCK)) {
return false; // Some types are not available on Windows
}
if (typeof this.mode === 'bigint') { // eslint-disable-line valid-typeof
if (typeof this.mode === 'bigint') {
return (this.mode & BigInt(S_IFMT)) === BigInt(property);
}
return (this.mode & S_IFMT) === property;
Expand Down
5 changes: 0 additions & 5 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@ function groupArrayElements(ctx, output, value) {
let order = 'padStart';
if (value !== undefined) {
for (let i = 0; i < output.length; i++) {
// eslint-disable-next-line valid-typeof
if (typeof value[i] !== 'number' && typeof value[i] !== 'bigint') {
order = 'padEnd';
break;
Expand Down Expand Up @@ -1087,7 +1086,6 @@ function formatPrimitive(fn, value, ctx) {
}
if (typeof value === 'number')
return formatNumber(fn, value);
// eslint-disable-next-line valid-typeof
if (typeof value === 'bigint')
return formatBigInt(fn, value);
if (typeof value === 'boolean')
Expand Down Expand Up @@ -1550,7 +1548,6 @@ function formatWithOptions(inspectOptions, ...args) {
const tempArg = args[++a];
if (typeof tempArg === 'number') {
tempStr = formatNumber(stylizeNoColor, tempArg);
// eslint-disable-next-line valid-typeof
} else if (typeof tempArg === 'bigint') {
tempStr = `${tempArg}n`;
} else {
Expand Down Expand Up @@ -1582,7 +1579,6 @@ function formatWithOptions(inspectOptions, ...args) {
break;
case 100: // 'd'
const tempNum = args[++a];
// eslint-disable-next-line valid-typeof
if (typeof tempNum === 'bigint') {
tempStr = `${tempNum}n`;
} else if (typeof tempNum === 'symbol') {
Expand All @@ -1606,7 +1602,6 @@ function formatWithOptions(inspectOptions, ...args) {
}
case 105: // 'i'
const tempInteger = args[++a];
// eslint-disable-next-line valid-typeof
if (typeof tempInteger === 'bigint') {
tempStr = `${tempInteger}n`;
} else if (typeof tempInteger === 'symbol') {
Expand Down
3 changes: 0 additions & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ const pwdCommand = isWindows ?


function platformTimeout(ms) {
// ESLint will not support 'bigint' in valid-typeof until it reaches stage 4.
// See https://github.com/eslint/eslint/pull/9636.
// eslint-disable-next-line valid-typeof
const multipliers = typeof ms === 'bigint' ?
{ two: 2n, four: 4n, seven: 7n } : { two: 2, four: 4, seven: 7 };

Expand Down
13 changes: 3 additions & 10 deletions tools/node_modules/eslint/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/node_modules/eslint/bin/eslint.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion tools/node_modules/eslint/lib/cli-engine/cli-engine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions tools/node_modules/eslint/lib/cli-engine/config-array-factory.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions tools/node_modules/eslint/lib/cli-engine/formatters/junit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions tools/node_modules/eslint/lib/linter/linter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions tools/node_modules/eslint/lib/linter/node-event-generator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b744bd9

Please sign in to comment.