From 8113e6d8c1a33f21c5ba22f7b50c63eafde05503 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 20 Jan 2015 21:25:12 +1100 Subject: [PATCH] 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 --- support/lint/browser.jshintrc | 1 + support/lint/node.jshintrc | 1 + 2 files changed, 2 insertions(+) diff --git a/support/lint/browser.jshintrc b/support/lint/browser.jshintrc index db66e533c0..9bf5d3fc6a 100644 --- a/support/lint/browser.jshintrc +++ b/support/lint/browser.jshintrc @@ -1,6 +1,7 @@ { "bitwise": true, "curly": true, + "freeze": true, "immed": true, "indent": 2, "latedef": true, diff --git a/support/lint/node.jshintrc b/support/lint/node.jshintrc index f7ade8d7f4..d79e5878cb 100644 --- a/support/lint/node.jshintrc +++ b/support/lint/node.jshintrc @@ -1,6 +1,7 @@ { "bitwise": true, "curly": true, + "freeze": true, "immed": true, "indent": 2, "latedef": true,