Make strict rules more specific
This commit is contained in:
parent
ae3fa21a3a
commit
47e6b7c772
10
test/lint.js
10
test/lint.js
|
@ -8,7 +8,7 @@ var formatter = cli.getFormatter();
|
||||||
|
|
||||||
var report;
|
var report;
|
||||||
|
|
||||||
describe('style-guide', function() {
|
describe('code style guide', function() {
|
||||||
it('index.js should follow our lint style guide', function(done) {
|
it('index.js should follow our lint style guide', function(done) {
|
||||||
cli = new eslint.CLIEngine({
|
cli = new eslint.CLIEngine({
|
||||||
'rules': {
|
'rules': {
|
||||||
|
@ -26,6 +26,11 @@ describe('style-guide', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('test/main.js should follow our lint style guide', function(done) {
|
it('test/main.js should follow our lint style guide', function(done) {
|
||||||
|
cli = new eslint.CLIEngine({
|
||||||
|
'rules': {
|
||||||
|
'strict': [ 2, 'global' ]
|
||||||
|
}
|
||||||
|
});
|
||||||
report = cli.executeOnFiles(['test/main.js']);
|
report = cli.executeOnFiles(['test/main.js']);
|
||||||
if (report.errorCount > 0 || report.warningCount > 0) {
|
if (report.errorCount > 0 || report.warningCount > 0) {
|
||||||
console.log(formatter(report.results));
|
console.log(formatter(report.results));
|
||||||
|
@ -39,7 +44,8 @@ describe('style-guide', function() {
|
||||||
it('test/lint.js should follow our lint style guide', function(done) {
|
it('test/lint.js should follow our lint style guide', function(done) {
|
||||||
cli = new eslint.CLIEngine({
|
cli = new eslint.CLIEngine({
|
||||||
'rules': {
|
'rules': {
|
||||||
'no-console': 0
|
'no-console': 0,
|
||||||
|
'strict': [ 2, 'global' ]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
report = cli.executeOnFiles(['test/lint.js']);
|
report = cli.executeOnFiles(['test/lint.js']);
|
||||||
|
|
Loading…
Reference in a new issue