sublimelsp / LSP-eslint

ESLint support for Sublime LSP plugin
MIT License
34 stars 5 forks source link

How to ignore certain codes? #61

Closed FichteFoll closed 1 year ago

FichteFoll commented 1 year ago

Upstream documents a eslint.rules.customizations setting that looks like it should be able to ignore certain codes (albeit this exact behavior is not explicitly mentioned). This settings is not mentioned in LSP-eslint's settings, but I tried using it as follows regardless:

{
    "settings": {
        "rules.customizations": [
            { "rule": "no-trailing-spaces", "severity": "off" },
            { "rule": "eol-last", "severity": "off" },
        ],
    },
}

Unfortunately, that didn't seem to have any effect. I also tried with eslint.rules.customizations and adding this to the global LSP settings file but that didn't make a difference either. (I also tried with a "downgrade" value to see whether it's just the "off" value that isn't supported.)

Is there a way currently for me to achieve what I want or does this need to be explcitly supported by the LSP plugin?

rchl commented 1 year ago

settings.rulesCustomizations is included (commented out) in the default settings and works for me. Try with that. Apart from the setting name, it looks good to me.

The naming discrepancy is because server supports rulesCustomizations but the VSCode extension for no good reason decided to map it to its own rules.customizations.

FichteFoll commented 1 year ago

Thank you for the quick response, that worked. I think I also realized why I couldn't find the setting, can you spot it? :facepalm:

2023-01-16_14-37-14

rchl commented 1 year ago

My case-sensitive option is perma-on so I'm always very aware of it. :)