Enable strict

This enables the function form of the "use strict" invocation. In
general, 'strict' is considered a good practice, so enabling it
is good. Requiring the function method of use strict avoid a
common bug encountered with a global strict declaration, where
the rule applies to all javascript that comes after the global
"use strict" statement. Using the function method prevents
brittleness, by creating a scope around the 'strict' case.

http://eslint.org/docs/rules/strict

Change-Id: I5c89c26d2d7a38c342e7c8f49f8cabe145dd02c0
This commit is contained in:
Michael Krotscheck 2015-08-28 09:01:30 -07:00
parent 165bb5bde2
commit cba4c7042d
3 changed files with 3 additions and 1 deletions

View File

@ -418,7 +418,7 @@ rules:
# controls location of Use Strict Directives
# http://eslint.org/docs/rules/strict
strict:
- 0 # TODO(krotscheck): Discuss & Activate
- 2
- "function"
#############################################################################

View File

@ -19,6 +19,7 @@
* as a module.
*/
(function () {
"use strict";
var yaml = require('js-yaml');
var fs = require('fs');

View File

@ -1,4 +1,5 @@
describe("Unit: eslint-config-openstack", function() {
"use strict";
it("should set espree as the default parser.", function() {
var config = require('../index');