tools: print a better message for unexpected use of globals · nodejs/node@dd89a11 (original) (raw)

Original file line number Diff line number Diff line change
@@ -4,7 +4,14 @@ env:
4 4 rules:
5 5 prefer-object-spread: error
6 6 no-buffer-constructor: error
7 -no-restricted-globals: ["error", "JSON", "Math", "Reflect"]
7 +no-restricted-globals:
8 + - error
9 + - name: JSON
10 +message: "Use `const { JSON } = primordials;` instead of the global."
11 + - name: Math
12 +message: "Use `const { Math } = primordials;` instead of the global."
13 + - name: Reflect
14 +message: "Use `const { Reflect } = primordials;` instead of the global."
8 15 no-restricted-syntax:
9 16 # Config copied from .eslintrc.js
10 17 - error