AtomLinter / linter-eslint-node

ESLint plugin for Atom/Pulsar Linter (v8 and above)
https://web.pulsar-edit.dev/packages/linter-eslint-node
MIT License
4 stars 3 forks source link

Suspend when listed in `linter.disabledProviders` #44

Open savetheclocktower opened 1 year ago

savetheclocktower commented 1 year ago

The package is in flux right now, and I’m working on six other things anyway, but I’m writing this down so I don’t forget about it.

Issue Type

Enhancement

Issue Description

I’ve been trying to make my own version of ide-typescript and finding that ESLint’s suggestions often overlap those of the TypeScript language server. It’s annoying to have the same issue annotated twice, especially since the two sources often disagree on severity. But I don't want to turn off linter-eslint-node entirely — just on certain projects.

The linter package allows you to specify a list of disabled providers in your settings, and I figured that’d work great with atomic-management — I’d just need to put something like this in .atom/config.cson:

"*":
  "linter":
    "disabledProviders": [
      "ESLint (Node)"
    ]

This does what it’s supposed to on linter’s side, but it’s not enough. Because we also go outside of the linter system to setup automatic fixes via fixJob.

We should be observing linter.disabledProviders so that we can do more thorough cleanup whenever that setting is changed to add or remove our linter. If the setting is changed to include our linter after we’ve loaded, we can suspend; and if it’s changed to remove our linter, we can wake up.

It would probably also be a good idea to include a shorthand setting within our package that accomplishes the same thing. This would allow per-project overrides for people who use our .linter-eslint config file instead of atomic-managment or project-config:

{
  "disabled": true
}

If either this setting or linter’s setting suggested we should be disabled, we’d disable ourselves.

scagood commented 1 year ago

Can you label this a bug please? 👀

savetheclocktower commented 1 year ago

Labelled it as both bug and enhancement. I'd split it into two different tickets, but I plan to tackle this soon anyway and will make sure to address it all in one PR.

savetheclocktower commented 1 year ago

(BTW, this issue's discovery led directly to the PR I wrote for Pulsar that took up most of my day yesterday.)