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

Commit 72f9cb5

Browse files
committed
CLI: do not keep adding preset from CLI
Fixes #2087
1 parent 787e80e commit 72f9cb5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

lib/config/configuration.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,9 @@ Configuration.prototype._loadPreset = function(preset) {
733733
return;
734734
}
735735

736+
// Do not keep adding preset from CLI (#2087)
737+
delete this._overrides.preset;
738+
736739
this._loadedPresets.push(preset);
737740

738741
// If preset is loaded from another preset - preserve the original name

test/specs/config/node-configuration.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,18 @@ describe('modules/config/node-configuration', function() {
175175

176176
expect(configuration.getFileExtensions()).to.deep.equal(['.js']);
177177
});
178+
179+
it('should not make a conflict between overrides and preset (#2087)', function() {
180+
configuration.registerPreset('jquery', {});
181+
182+
configuration.overrideFromCLI({
183+
preset: 'jquery'
184+
});
185+
186+
configuration.load({});
187+
188+
expect(configuration.getFileExtensions()).to.deep.equal(['.js']);
189+
});
178190
});
179191

180192
describe('load', function() {

0 commit comments

Comments
 (0)