Yes, it does help, thank you! I did figure out the null method by looking at the code and doing some testing.
I think my confusion stemmed from an unclear interpretation of the word "extends" in the documentation. For example, in the case of arrays, I think I might have assumed it could mean one of the following: 1. Array values will be added together, as in https://stackoverflow.com/questions/1374126/how-to-extend-an-existing-javascript-array-with-another-array-without-creating 2. Array values will be added together, with duplicates removed, as in https://lodash.com/docs/#union 3. Array values will be overridden, as with rule options I think I was assuming that the "extend" behavior was special in general due to the special rules extend behavior and that the special behavior for the other options was simply not documented. It does seem like there might be some use cases for one or more of the behaviors listed above, although I'm sure there are good reasons for the current behavior and perhaps special behavior(s) for the non-rule options has already been considered? Thanks On Friday, September 20, 2019 at 1:34:15 PM UTC-4, Nicholas Zakas wrote: > > 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] > <javascript:>> 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] <javascript:>. >> 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/9543d829-dcf4-412e-bff9-5feadafb8795%40googlegroups.com.
