lifeart/vsc-ember-syntax

Unable to use this plugin alongside eslint plugin

Closed this issue · 6 comments

If you use the ESLint VSCode plugin to highlight errors, this plugin will downgrade all your errors to warnings.

I think it's because of this unconditionally applied change to the user config on every boot.

eslintConfig.update('rules.customizations', [{ rule: '*', severity: 'warn' }], vscode.ConfigurationTarget.Global);

Does this plugin require this config to work? Could it be made conditional and controllable by a setting? Could it be eliminated entirely?

Hi @apellerano-pw, thank you for report!
This changes landed in scope of https://github.com/lifeart/vsc-ember-syntax/pull/31/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R50

Maybe @evoactivity may help to figure out how we could solve it.

As possible fix I think we could avoid overriding and replace it with extending.
Smf like:

const validate = eslintConfig.get('validate') ?? [];
const glimmerScopes = ['glimmer-ts', 'glimmer-js'];
eslintConfig.update('validate', Array.from(new Set([...validate, ...glimmerScopes])), vscode.ConfigurationTarget.Global);

And I think it make sence to change ConfigurationTarget.Global to ConfigurationTarget.Workspace.

I think that suggestion should be fine @lifeart. We might even consider removing it entirely to be honest.

I think the reason I added that at all was because after I upgraded my project and workspace to use gts etc and I was working on improving highlighting support I noticed everything that was a warning before was now an error (maybe correctly?).

I'm fine with removal, since we already have it documented in readme (users could tweak eslint if needed)

@apellerano-pw changes published v1.0.17

Thank you, just tested the 1.0.17 version and it shows eslint errors as intended!