tools: print a better message for unexpected use of globals
PR-URL: https://github.com/nodejs/node/pull/27083 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
de23055536
commit
dd89a1182f
@ -4,7 +4,14 @@ env:
|
|||||||
rules:
|
rules:
|
||||||
prefer-object-spread: error
|
prefer-object-spread: error
|
||||||
no-buffer-constructor: 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:
|
no-restricted-syntax:
|
||||||
# Config copied from .eslintrc.js
|
# Config copied from .eslintrc.js
|
||||||
- error
|
- error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user