Enable the freeze option for JSHint
Summary:
This option prohibits overwriting prototypes of native objects such as `Array`, `Date` and so on.
```lang=js
// jshint freeze:true
Array.prototype.count = function (value) { return 4; };
// -> Warning: Extending prototype of native object: 'Array'.
```
Test Plan: Linted existing JavaScript files, found no violations.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11439
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"bitwise": true,
|
"bitwise": true,
|
||||||
"curly": true,
|
"curly": true,
|
||||||
|
"freeze": true,
|
||||||
"immed": true,
|
"immed": true,
|
||||||
"indent": 2,
|
"indent": 2,
|
||||||
"latedef": true,
|
"latedef": true,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"bitwise": true,
|
"bitwise": true,
|
||||||
"curly": true,
|
"curly": true,
|
||||||
|
"freeze": true,
|
||||||
"immed": true,
|
"immed": true,
|
||||||
"indent": 2,
|
"indent": 2,
|
||||||
"latedef": true,
|
"latedef": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user