fluid-project / fluid-lint-all

Consolidated linting logic free from any particular build technology
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

Array values do not override properly in sources #29

Closed amb26 closed 3 years ago

amb26 commented 3 years ago

When adding, for example, a sources entry which looks as follows:

    "sources": {
        "css": ["./thing.css"], 

the resulting value received by the linter still retains mouse droppings of the last two entries in the grade defaults, e.g.

  includes: [ './thing.css', './src/**/*.css', 'tests/**/*.css' ],

This is unlikely to be what the user intended. There should be a mergePolicy applied here to displace the default values.

greatislander commented 3 years ago

Perhaps related to #21?

amb26 commented 3 years ago

Yup, looks like the same cause

the-t-in-rtf commented 3 years ago

@amb26, I think we should chat a bit about this. I proposed the same fix for #21 before I saw this. In that ticket, @greatislander is actually asking for the opposite, having user excludes added to the defaults. Otherwise adding even one of your own excludes means that you have to add them all.

the-t-in-rtf commented 3 years ago

I think I have an approach, I'll convert it to a map internally and reuse "bang notation" for material to be excluded/removed. That should balance the need to add material with the need to clobber defaults that don't work for everyone.

amb26 commented 3 years ago

I think I have an approach, I'll convert it to a map internally and reuse "bang notation" for material to be excluded/removed. That should balance the need to add material with the need to clobber defaults that don't work for everyone.

Could you explain how this would work in a little more detail? I couldn't easily follow from the new impl. Do you mean that includes will clobber all defaults, and that excludes will continue to work additively?