summaryrefslogtreecommitdiff
path: root/lib/.eslintrc.yaml
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-04-04 11:36:41 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-06 12:04:36 +0800
commitde230555369087282213d337ecc1c315fbb74230 (patch)
tree19e10179deff9ba47dac546af566e09a4a3f9a66 /lib/.eslintrc.yaml
parent864860e9f3d4eed0b0b81af55197d7e525ea6306 (diff)
downloadandroid-node-v8-de230555369087282213d337ecc1c315fbb74230.tar.gz
android-node-v8-de230555369087282213d337ecc1c315fbb74230.tar.bz2
android-node-v8-de230555369087282213d337ecc1c315fbb74230.zip
lib: remove `env: node` in eslint config for lib files
This patch removes the redundant `require-globals` custom eslint rule by removing `env: node` in the eslint config and whitelist the globals that can be accessed in native modules instead of black listing them. This makes sense for our `lib/` files because here we are creating the Node.js environment instead of running in a normal user land Node.js environment. PR-URL: https://github.com/nodejs/node/pull/27082 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/.eslintrc.yaml')
-rw-r--r--lib/.eslintrc.yaml22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index 029d7ad177..2ec4dc8048 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -1,3 +1,6 @@
+env:
+ es6: true
+
rules:
prefer-object-spread: error
no-buffer-constructor: error
@@ -19,10 +22,11 @@ rules:
- selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']"
message: "Please use `require('internal/errors').hideStackFrames()` instead."
# Custom rules in tools/eslint-rules
- node-core/require-globals: error
node-core/lowercase-name-for-primitive: error
node-core/non-ascii-character: error
globals:
+ Intl: false
+ # Assertions
CHECK: false
CHECK_EQ: false
CHECK_GE: false
@@ -37,5 +41,21 @@ globals:
DCHECK_LE: false
DCHECK_LT: false
DCHECK_NE: false
+ # Parameters passed to internal modules
+ global: false
+ require: false
+ process: false
+ exports: false
+ module: false
internalBinding: false
primordials: false
+ # Globals
+ # TODO(joyeecheung): if possible, get these in native modules
+ # through `require` instead of grabbing them from the global proxy.
+ clearTimeout: false
+ setTimeout: false
+ clearInterval: false
+ setInterval: false
+ setImmediate: false
+ clearImmediate: false
+ console: false