Skip to content
Permalink
Browse files

Fix: `eslint:all` causes regression in 3.1.0 (fixes #6687) (#6696)

  • Loading branch information...
alberto authored and nzakas committed Jul 18, 2016
1 parent cb90359 commit 565e584c3ad879aa9aee34b888a973665a4b7ada
Showing with 44 additions and 1 deletion.
  1. +3 −1 conf/eslint-all.js
  2. +41 −0 tests/conf/eslint-all.js
@@ -18,7 +18,9 @@ var fs = require("fs"),

var ruleFiles = fs.readdirSync(path.resolve(__dirname, "../lib/rules"));
var enabledRules = ruleFiles.reduce(function(result, filename) {
result[path.basename(filename, ".js")] = "error";
if (path.extname(filename) === ".js") {
result[path.basename(filename, ".js")] = "error";
}
return result;
}, {});

@@ -0,0 +1,41 @@
/**
* @fileoverview Tests for eslint-all.
* @author Alberto Rodríguez
*/

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var assert = require("chai").assert,
eslintAll = require("../../conf/eslint-all"),
rules = eslintAll.rules;

describe("eslint-all", function() {
it("should only include rules", function() {
var ruleNames = Object.keys(rules);

assert.notInclude(ruleNames, ".eslintrc.yml");

});

it("should return all rules", function() {
var ruleNames = Object.keys(rules);
var count = ruleNames.length;
var someRule = "yoda";

assert.include(ruleNames, someRule);
assert.isAbove(count, 200);
});

it("should configure all rules as errors", function() {
var ruleNames = Object.keys(rules);
var nonErrorRules = ruleNames.filter(function (ruleName) {
return rules[ruleName] !== "error";
});

assert.equal(nonErrorRules.length, 0);
});
});

0 comments on commit 565e584

Please sign in to comment.
You can’t perform that action at this time.