This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better ban rule failure messages & allows for additional custom messa…
…ges (#1385) * Updating ban rule to have better messages, and an optional explanation message as a 3rd parameter
- Loading branch information
1 parent
0eab08d
commit a049830
Showing
5 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
console.time(); | ||
window.toString(); | ||
~~~~~~~~~~~~~~~ [function invocation disallowed: window.toString] | ||
~~~~~~~~~~~~~~~ [Calls to 'window.toString' are not allowed.] | ||
console.log(); | ||
document.window.toString(); | ||
~~~~~~~~~~~~~~~~~~~~~~~~ [function invocation disallowed: window.toString] | ||
~~~~~~~~~~~~~~~~~~~~~~~~ [Calls to 'window.toString' are not allowed.] | ||
reference.randomContainer.window.toString(); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [function invocation disallowed: window.toString] | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Calls to 'window.toString' are not allowed.] | ||
globals.getDocument().window.toString(); | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [function invocation disallowed: window.toString] | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Calls to 'window.toString' are not allowed.] | ||
_.keys(obj).forEach(fun); | ||
_.forEach(fun); | ||
~~~~~~~~~ [function invocation disallowed: _.forEach] | ||
~~~~~~~~~ [Calls to '_.forEach' are not allowed.] | ||
_.filter(array); | ||
~~~~~~~~ [Calls to '_.filter' are not allowed. Use the native JavaScript 'myArray.filter' instead.] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{ | ||
"rules": { | ||
"ban": [true, ["window", "toString"], ["_", "forEach"]] | ||
"ban": [ | ||
true, | ||
["window", "toString"], | ||
["_", "forEach"], | ||
["_", "filter", "Use the native JavaScript 'myArray.filter' instead."] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
console.time(); | ||
console.log("log"); | ||
~~~~~~~~~~~ [function invocation disallowed: console.log] | ||
~~~~~~~~~~~ [Calls to 'console.log' are not allowed.] | ||
console.dir(object); | ||
~~~~~~~~~~~ [function invocation disallowed: console.dir] | ||
~~~~~~~~~~~ [Calls to 'console.dir' are not allowed.] | ||
console.info("info"); | ||
console.trace("trace"); | ||
console.warn("warn"); | ||
~~~~~~~~~~~~ [function invocation disallowed: console.warn] | ||
~~~~~~~~~~~~ [Calls to 'console.warn' are not allowed.] | ||
console.error("error"); | ||
~~~~~~~~~~~~~ [function invocation disallowed: console.error] | ||
~~~~~~~~~~~~~ [Calls to 'console.error' are not allowed.] | ||
console.something(); | ||
console.timeEnd(); |