From d8188133b745585c22a9dff5a4ed4246c362cf2e 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 1/2] tools: print a better message for unexpected use of globals --- lib/.eslintrc.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 029d7ad177f468..f0ccdbc2e1a4d0 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -1,7 +1,14 @@ 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 From fac70624cc31aaae88c4d406350defa276af7221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 4 Apr 2019 08:17:27 +0200 Subject: [PATCH 2/2] fixup! tools: print a better message for unexpected use of globals period --- lib/.eslintrc.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index f0ccdbc2e1a4d0..1e01f8d2367ebe 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -4,11 +4,11 @@ rules: no-restricted-globals: - error - name: JSON - message: "Use `const { JSON } = primordials;` instead of the global" + message: "Use `const { JSON } = primordials;` instead of the global." - name: Math - message: "Use `const { Math } = primordials;` instead of the global" + message: "Use `const { Math } = primordials;` instead of the global." - name: Reflect - message: "Use `const { Reflect } = primordials;` instead of the global" + message: "Use `const { Reflect } = primordials;` instead of the global." no-restricted-syntax: # Config copied from .eslintrc.js - error