neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
9.98k stars 2.04k forks source link

fix(eslint): useFlatConfig is not experimental anymore #3183

Closed saifulapm closed 1 month ago

saifulapm commented 1 month ago

As Support for the new ESLint flat config files has improved

eslint.experimental.useFlatConfig

should be

eslint.useFlatConfig

I have tested with flat config. experimental not working anymore.

MrRoiz commented 1 month ago

maybe related with this? image

This is all the config that I have for eslint image

d-mitrofanov-v commented 1 month ago

@saifulapm @glepnir It seems that the experimental setting shouldn't be deleted as it is still used by old versions

The experimental settings eslint.experimental.useFlatConfig is deprecated and should only be used for ESLint versions >= 8.21 < 8.57.0.

saifulapm commented 1 month ago

Yes but if someone use old version, they can overwrite this in their own config. Default I think should need to be stick with latest version config.

MrRoiz commented 1 month ago

Yes but if someone use old version, they can overwrite this in their own config. Default I think should need to be stick with latest version config.

@saifulapm Is it not possible to support both and avoid that workaround in configs that needs to use those old versions?

saifulapm commented 1 month ago

Yes.. we can keep both also.

saifulapm commented 1 month ago

maybe related with this? image

This is all the config that I have for eslint image

@MrRoiz Can you share you full eslint lspconfig ?

MrRoiz commented 1 month ago

@saifulapm well, that's all config that I sent to the eslint lsp actually, I'm using LazyVim, it just installs that lsp and calls the setup method with the data assigned to that key.

image

saifulapm commented 1 month ago

@MrRoiz This is workaround until solution

  eslint = {
    settings = {
      workingDirectories = { mode = "auto" },
      experimental = {
        useFlatConfig = false,
      },
    },
  },
MrRoiz commented 1 month ago

@saifulapm not sure of how mason lspconfig can generate the issue, but anyways the workaround works. thanks! let me know if you figure out a solution to avoid that workaround.

RayGuo-ergou commented 1 month ago

I think eslint.experimental.useFlatConfig should be added back, as they are deprecated not removed.

see: https://github.com/microsoft/vscode-eslint/blob/main/%24shared/settings.ts#L161

thus the eslint-lsp server will still try to read it.

I can make a PR after work for this.

kesor commented 1 month ago

This premature "fix" stole two days of my life. The new server is not yet released even, it is in pre-release, and the old server is broken because of this "fix". ROLL IT BACK.

kesor commented 1 month ago

@glepnir please revert this.

glepnir commented 1 month ago

it has been revert.