lib: enforce use of Boolean from primordials

Refs: https://github.com/nodejs/node/issues/30697

PR-URL: https://github.com/nodejs/node/pull/30698
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
Michaël Zasso 2019-11-28 08:19:55 +01:00
parent 0da6983cda
commit 7fc5980cfe
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
9 changed files with 20 additions and 0 deletions

View File

@ -11,6 +11,8 @@ rules:
- error
- name: Array
message: "Use `const { Array } = primordials;` instead of the global."
- name: Boolean
message: "Use `const { Boolean } = primordials;` instead of the global."
- name: JSON
message: "Use `const { JSON } = primordials;` instead of the global."
- name: Math

View File

@ -23,6 +23,7 @@
const {
ArrayIsArray,
Boolean,
ObjectAssign,
ObjectKeys,
ObjectSetPrototypeOf,

View File

@ -1,4 +1,9 @@
'use strict';
const {
Boolean,
} = primordials;
const assert = require('internal/assert');
const net = require('net');
const { sendHelper } = require('internal/cluster/utils');

View File

@ -6,6 +6,7 @@
const {
ArrayFrom,
ArrayIsArray,
Boolean,
MathFloor,
ObjectDefineProperties,
ObjectDefineProperty,

View File

@ -2,6 +2,7 @@
const {
ArrayIsArray,
Boolean,
ObjectAssign,
ObjectCreate,
ObjectKeys,

View File

@ -1,5 +1,9 @@
'use strict';
const {
Boolean,
} = primordials;
// Regex used for ansi escape code splitting
// Adopted from https://github.com/chalk/ansi-regex/blob/master/index.js
// License: MIT, authors: @sindresorhus, Qix-, and arjunmehta

View File

@ -1,5 +1,9 @@
'use strict';
const {
Boolean,
} = primordials;
const { Interface } = require('readline');
const path = require('path');
const fs = require('fs');

View File

@ -23,6 +23,7 @@
const {
ArrayIsArray,
Boolean,
ObjectDefineProperty,
ObjectSetPrototypeOf,
} = primordials;

View File

@ -2,6 +2,7 @@
const {
ArrayIsArray,
Boolean,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,