Skip to content

Commit

Permalink
tools: print a better message for unexpected use of globals
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
targos committed Apr 6, 2019
1 parent de23055 commit dd89a11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd89a11

Please sign in to comment.