From dd89a1182f0f6acfa46d79fbecf65aad9def9a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 4 Apr 2019 08:13:25 +0200 Subject: [PATCH] tools: print a better message for unexpected use of globals PR-URL: https://github.com/nodejs/node/pull/27083 Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau Reviewed-By: Yongsheng Zhang Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- lib/.eslintrc.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 2ec4dc80480e83..12375c06eded90 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -4,7 +4,14 @@ env: rules: prefer-object-spread: error no-buffer-constructor: error - no-restricted-globals: ["error", "JSON", "Math", "Reflect"] + no-restricted-globals: + - error + - name: JSON + message: "Use `const { JSON } = primordials;` instead of the global." + - name: Math + message: "Use `const { Math } = primordials;` instead of the global." + - name: Reflect + message: "Use `const { Reflect } = primordials;` instead of the global." no-restricted-syntax: # Config copied from .eslintrc.js - error