Skip to content

Commit dd89a11

Browse files
committed
tools: print a better message for unexpected use of globals
PR-URL: #27083 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent de23055 commit dd89a11

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/.eslintrc.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ env:
44
rules:
55
prefer-object-spread: error
66
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."
815
no-restricted-syntax:
916
# Config copied from .eslintrc.js
1017
- error

0 commit comments

Comments
 (0)