Hi Geraldo,

The only special merging behavior is in the rules section of the config.
Every other object (settings, parserOptions, etc.) effectively worked by
using Object.assign() where the first objects are the ones from the configs
you're extending and the last is your .eslintrc.* file.

As such, it's not possible to clear all settings. You can clear an
individual setting key by assigning it to null. It is not possible to
modify the value of a settings key, so no, it's not possible to just remove
".jsx" from the array. You'd have to completely overwrite the array with
just what you want.

I hope this helps.

On Fri, Sep 20, 2019 at 6:59 AM Geraldo Alvarez <[email protected]>
wrote:

> Added GitHub issue: https://github.com/eslint/eslint/issues/12295
>
> On Friday, September 20, 2019 at 9:39:10 AM UTC-4, Geraldo Alvarez wrote:
>>
>> From a cursory look at the code, it looks like the merges of the
>> different parts of configs is handled here?
>> https://github.com/eslint/eslint/blob/v6.4.0/lib/cli-engine/config-array/config-array.js#L238-L273
>>
>> To my knowledge, the behavior entailed by that code is not explained in
>> the documentation. I will file an issue in the GitHub repo related to this.
>>
>> On Thursday, September 19, 2019 at 5:23:55 PM UTC-4, Geraldo Alvarez
>> wrote:
>>>
>>> Does the documentation fully explain how configs are merged?
>>>
>>>
>>> https://eslint.org/docs/user-guide/configuring#extending-configuration-files
>>> explains how rules are extended or overriden, but how about other
>>> non-primitive config properties, for example, settings?
>>>
>>> For example, suppose I have the following config:
>>>
>>> "settings": { "import/extensions": [ ".js", ".jsx" ] }
>>>
>>> 1. Would it be possible for a config extending this config to clear all 
>>> settings? If so, how?
>>> 2. Would it be possible for a config extending this config to clear the 
>>> "import/extensions" settings? If so, how?
>>> 3. Would it be possible for a config extending this config to remove ".jsx" 
>>> from the array? If so, how?
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "ESLint" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/eslint/d0ed1f9d-070f-42e9-912c-7661b0f5f53c%40googlegroups.com
> <https://groups.google.com/d/msgid/eslint/d0ed1f9d-070f-42e9-912c-7661b0f5f53c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

______________________________
Nicholas C. Zakas
@slicknet

Author, Principles of Object-Oriented JavaScript <http://amzn.to/29Pmfrm>
Author, Understanding ECMAScript 6 <http://amzn.to/29K1mIy>

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/eslint/CAOkd9hn%2BvPm0xvQobmLCDzshCwxvT1Y6ASws7jK55umLwZEvLA%40mail.gmail.com.

Reply via email to