Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit e7ead38

Browse files
committed
Auto-configure: pass infinity to maxErrors
Fixes #1695
1 parent d75027b commit e7ead38

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

lib/config/generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Generator.prototype._handleViolatedRules = function(errorPrompts, choices) {
183183
Generator.prototype._checkAgainstPreset = function(path, presetName) {
184184
var checker = getChecker();
185185

186-
checker.configure({preset: presetName});
186+
checker.configure({preset: presetName, maxErrors: Infinity});
187187

188188
return checker.checkPath(path);
189189
};

test/specs/config/generator.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ describe('lib/config/generator', function() {
8585
showErrorCountsStub.restore();
8686
});
8787

88+
it('checks with infinity `maxErrors` option', function() {
89+
var checkPathStub = sinon.stub(Checker.prototype, 'checkPath');
90+
var configureStub = sinon.stub(Checker.prototype, 'configure');
91+
// For preventing subsequent steps from running
92+
var showErrorCountsStub = sinon.stub(generator, '_showErrorCounts').throws();
93+
94+
generator.generate(_path);
95+
96+
var args = configureStub.getCall(0).args[0];
97+
expect(args).to.have.property('maxErrors');
98+
expect(args.maxErrors).to.equal(Infinity);
99+
100+
checkPathStub.restore();
101+
configureStub.restore();
102+
showErrorCountsStub.restore();
103+
});
104+
88105
it('displays a count of errors for every preset', function(done) {
89106
var stub = sinon.stub(generator, '_getUserPresetChoice').throws();
90107
var presetNames = Object.keys(getChecker().getConfiguration().getRegisteredPresets());

0 commit comments

Comments
 (0)