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:
Michaël Zasso 2019-04-04 08:13:25 +02:00
parent de23055536
commit dd89a1182f
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -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