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:
parent
165bb5bde2
commit
cba4c7042d
@ -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"
|
||||
|
||||
#############################################################################
|
||||
|
1
index.js
1
index.js
@ -19,6 +19,7 @@
|
||||
* as a module.
|
||||
*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var yaml = require('js-yaml');
|
||||
var fs = require('fs');
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user