pulsar-linter / linter-eslint-node

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

Suspend when listed in `linter.disabledProviders` #8

Open scagood opened 1 year ago

scagood commented 1 year ago

Original issue: https://github.com/AtomLinter/linter-eslint-node/issues/44

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.