plugins icon indicating copy to clipboard operation
plugins copied to clipboard

VS Code warning about soon-to-be-dropped code action

Open philsherry opened this issue 2 years ago • 3 comments

Quick fixes have stopped working for me.

VS Code saying “Checking for quick fixes...”

Now I just get stuck on “Checking for quick fixes...” and the following warning in the Extension Host console:

[warning] trunk.io - Code actions of kind 'quickfix 'requested but returned code action is of kind 'source.fixAll'. 
Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
cli:
  version: 1.21.0
plugins:
  sources:
    - id: trunk
      ref: v1.4.5

philsherry avatar Apr 02 '24 08:04 philsherry

Hi @philsherry! Sorry for the delay on this. This is the first time we've seen this issue. Could you provide some additional information:

  1. What version of VSCode are you running?
  2. Does this only happen in JS/TS files and only with eslint or also with other linters?
  3. Is there any pattern of behavior that causes this to happen? Does the issue temporarily go away when you reload (close/relaunch) VSCode?

TylerJang27 avatar Apr 17 '24 22:04 TylerJang27

Took me a few days to get back to this, but:

  1. My VS Code is always latest production, so it was whatever release version was current at the time.
  2. It was ESLint-specific as far as I could tell.
  3. It had become default behaviour.

In the time it's taken for us both to respond, this is no longer happening. However…

stderr: |
  Oops! Something went wrong! :(
  ESLint: 9.0.0
  Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from eslint.config.js

I’ve since tried updating to ESLint 9 and Trunk doesn’t seem to like it. So, maybe the issue has been fixed by an updated VS Code, or maybe it’s Trunk’s inability to handle the ESLint 9 config? Could be either. Or both. Or neither. 😄

Is there anything specific that is required to switch from ESLint 8 -> 9? I assume you've given it a good going over to check.

Edit: I had a look at the suggested config for it and it doesn’t look to be covered here. I see only legacy config file names in the array—not the newer, flat config style.

They’re already up to 9.1.1 with the new release, so I don’t consider this to be a cutting-edge release; especially when flat config has been available throughout a lot of version 8. In case it’s of any use, I’ll link to the Issue where they’ve been tracking the rollout of a lot of the plugins and shared configs: Tracking: Flat Config rollout.

philsherry avatar Apr 21 '24 13:04 philsherry

Hi! Glad the original issue is no longer a problem. As for Eslint9, we are aware of the new eslint flat config changes and haven't finalized our approach for upgrading our existing users. With that being said, we just landed some temporary migration guidelines if you want to start using ESlint9. Please let us know if you encounter any issues with that override.

We plan to have a more OOTB approach for Eslint9, but it's likely a few weeks out from being released, so you should use the override in the meantime

TylerJang27 avatar Apr 23 '24 01:04 TylerJang27