Extend option overwrites options in the wrong direction #1439

Closed
mikesherov opened this Issue Dec 25, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

mikesherov commented Dec 25, 2013

given the following configuration:

b.jshintrc

{
    maxlen: 10
}

a.jshintrc

{
    extend: 'b.jshintrc',
    maxlen: 20
}

produces maxlen:10 in a.jshintrc. This is because the arguments to _.extend are backwards here:

_.extend(config, exports.loadConfig(path.resolve(config.dirname, config['extends'])));

As the underscore docs say in http://underscorejs.org/#extend:

extend_.extend(destination, *sources)
Copy all of the properties in the source objects over to the destination object, and return the destination object. It's in-order, so the last source will override properties of the same name in previous arguments.

mgol referenced this issue in jquery/jquery Dec 27, 2013

Closed

Build: Use jsHint extends option #1471

@valueof valueof added a commit that referenced this issue Jan 3, 2014

@mikesherov @valueof mikesherov + valueof Issue #1439: Make extend option to overwrite in the right direction
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
5f75b2c

@valueof valueof added a commit that referenced this issue Jan 3, 2014

@mikesherov @valueof mikesherov + valueof Issue #1439: Make extend option to overwrite in the right direction
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
16c435c
Owner

valueof commented Jan 3, 2014

Fixed both in 2.x and master.

valueof closed this Jan 3, 2014

@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

@mikesherov @jugglinmike mikesherov + jugglinmike Issue #1439: Make extend option to overwrite in the right direction
Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
c7d5547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment