AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.04k stars 214 forks source link

eslint or prettierd error #966

Closed taotao7 closed 1 month ago

taotao7 commented 1 month ago

Checklist

Neovim version (nvim -v)

0.10.0

Operating system/version

macos 14.4.1

Terminal/GUI

iterm2

Describe the bug

The first file source code file can be automatically formatted, but the second open file will be formatted failed, not sure when prettier or eslint problem, delete the eslint configuration file can be, as long as the project under the existence of eslint configuration rules will appear this problem!

Steps to Reproduce

  1. front or node project
  2. have eslint config module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', ], ignorePatterns: ['dist', '.eslintrc.cjs'], parser: '@typescript-eslint/parser', plugins: ['react-refresh'], rules: { 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], '@typescript-eslint/no-explicit-any': ['off'], 'react-hooks/rules-of-hooks': ['off'], 'react-hooks/exhaustive-deps': 'off', }, }
  3. open one ts or js file
  4. save format
  5. open two ts or js file
  6. format error

Expected behavior

save format can be normal

Screenshots

image

Additional Context

The file is not important, as long as it is the second open file, it will not be formatted

Uzaaft commented 1 month ago

Try and re-install the LSP's.

fynnfluegge commented 1 month ago

Similar issue here recently, had to uninstall astrocommunity.pack.typescript to fix it 🥹

gabrielscaranello commented 1 month ago

Same problem here. I tried using previous versions of astrocommunity, but it still didn't work.

taotao7 commented 1 month ago

Try and re-install the LSP's.

not work ,may be lsp server error

taotao7 commented 1 month ago

I guess there should be something wrong with the pretterd version installed by Mason.

taotao7 commented 1 month ago

I've confirmed that it doesn't seem to be a version problem of eslint_d or prettierd, because they have not been updated in recent weeks.

taotao7 commented 1 month ago

Similar issue here recently, had to uninstall astrocommunity.pack.typescript to fix it 🥹

i know ,but if I were to remove the typescript pack, wouldn't I not support JS TS?🧐

taotao7 commented 1 month ago

Brothers, please return to 8.3.0 for the time being. I tested this version and it works fine.

user.lua {

"AstroNvim/astrocommunity",
version = "8.3.0",

},

@Uzaaft

taotao7 commented 1 month ago

@fynnfluegge @gabrielscaranello

MrMic commented 1 month ago

Same issue here. It seems to have something to do with prettier. I saw some updates about this recently.

Capture d’écran du 2024-05-16 09-57-45

BTW: Switching to 8.3.0 does not fix the issue. I still have this, with NextJS projects...

taotao7 commented 1 month ago

Same issue here. It seems to have something to do with prettier.

I saw some updates about this recently.

Capture d’écran du 2024-05-16 09-57-45

BTW: Switching to 8.3.0 does not fix the issue. I still have this,

with NextJS projects...

try to edit eslint config

{ "extends": "next" }

gabrielscaranello commented 1 month ago

Using version 8.3.0 didn't solve it for me either. Linting and formatting are working normally, the eslint diagnosis is broken. See the difference, the same project, VSCode vs Neovim.

VSCode Neovim
image image
MrMic commented 1 month ago

Same issue here. It seems to have something to do with prettier. I saw some updates about this recently. Capture d’écran du 2024-05-16 09-57-45 BTW: Switching to 8.3.0 does not fix the issue. I still have this, with NextJS projects...

try to edit eslint config

{ "extends": "next" }

We are all senior Devs here, so I have done this and much more to solve this issue...

taotao7 commented 1 month ago

Same issue here. It seems to have something to do with prettier.

I saw some updates about this recently.

Capture d’écran du 2024-05-16 09-57-45

BTW: Switching to 8.3.0 does not fix the issue. I still have this,

with NextJS projects...

try to edit eslint config

{ "extends": "next" }

We are all senior Devs here, so I have done this and much more to

solve this issue...

That sounds great. How did you solve this problem?

Under normal circumstances, you should definitely not choose to modify eslint config. This is just for me to use it temporarily. I want to wait for the official repair, but I heard that you have solved this problem, so I would like to ask for advice.

gabrielscaranello commented 1 month ago

Neovim released stable version 0.10.0 a few minutes ago. The issue was fixed after upgrading to the latest version of neovim.

image

image

I'm running on Zorin OS 17.1, and I'm manually building neovim.

taotao7 commented 1 month ago

Neovim released stable version 0.10.0 a few minutes ago.

The issue was fixed after upgrading to the latest version of neovim.

image

image

I'm running on Zorin OS 17.1, and I'm manually building neovim.

nice btw:

I'm already 0.10.0, but I'm from homebrew install neovim —head. I'll try to reinstall it tomorrow.

Uzaaft commented 1 month ago

Wait, @taotao7 Do you use neovim nightly?

taotao7 commented 1 month ago

Wait, @taotao7 Do you use neovim nightly?

I have changed the official version of neovim I am using to 0.10.0, but it is still the same

taotao7 commented 1 month ago

I retested it again, deleted astronvim and reinstalled it, after installing it was all the default configuration, and then only enabled typescript pack, still this problem, I used neovim 0.10.0 official version released yesterday

gabrielscaranello commented 1 month ago

I retested it again, deleted astronvim and reinstalled it, after installing it was all the default configuration, and then only enabled typescript pack, still this problem, I used neovim 0.10.0 official version released yesterday

@taotao7, try using my configuration, just for testing purposes. Note that there are many other settings besides TS. Neovim config

taotao7 commented 1 month ago

I retested it again, deleted astronvim and reinstalled it, after installing it was all the default configuration, and then only enabled typescript pack, still this problem, I used neovim 0.10.0 official version released yesterday

@taotao7, try using my configuration, just for testing purposes. Note that there are many other settings besides TS. Neovim config

Thanks I'll try it

taotao7 commented 1 month ago

I retested it again, deleted astronvim and reinstalled it, after installing it was all the default configuration, and then only enabled typescript pack, still this problem, I used neovim 0.10.0 official version released yesterday

@taotao7, try using my configuration, just for testing purposes. Note that there are many other settings besides TS. Neovim config

Yes, your configuration works for me.

taotao7 commented 1 month ago

@gabrielscaranello

thanks bro

I made modifications based on your configuration. I have a question. I don’t see how you configured it. When typing: Telecope can pop up.

gabrielscaranello commented 1 month ago

@taotao7, great that it worked for you, bro. The only change I made to the telescope config was to add file_ignore_patterns. Here everything works perfectly. Or maybe I didn't understand your question.

Uzaaft commented 1 month ago

I just tested with base v4 and typescript pack, no issues with eslint and prettier here

taotao7 commented 1 month ago

I just tested with base v4 and typescript pack, no issues with eslint and prettier here Is there anything wrong with the default configuration? No way, we're all running into this issue, I've now respecified the format by specifying the none-ls configuration

taotao7 commented 1 month ago

@taotao7, great that it worked for you, bro. The only change I made to the telescope config was to add file_ignore_patterns. Here everything works perfectly. Or maybe I didn't understand your question.

thanks again,I mean, when using your configuration, when you enter a colon in normal mode, a telescope cmdline box pops up, and it feels like a good experience, I want to ask how you did it

taotao7 commented 1 month ago

I just tested with base v4 and typescript pack, no issues with eslint and prettier here

First of all, thank you, maybe you can try to open a nextjs project, configure eslint, then open the two ts files of the project, and then format the file to save one file, and modify the second file, at this time the save format will be wrong

gabrielscaranello commented 1 month ago

@taotao7, great that it worked for you, bro. The only change I made to the telescope config was to add file_ignore_patterns. Here everything works perfectly. Or maybe I didn't understand your question.

thanks again,I mean, when using your configuration, when you enter a colon in normal mode, a telescope cmdline box pops up, and it feels like a good experience, I want to ask how you did it

The plugin that does this is noice.nvim. It's not a telescope dialog (although it looks like it), it's a prompt for command mode in neovim.

taotao7 commented 1 month ago

@taotao7, great that it worked for you, bro. The only change I made to the telescope config was to add file_ignore_patterns. Here everything works perfectly. Or maybe I didn't understand your question.

thanks again,I mean, when using your configuration, when you enter a colon in normal mode, a telescope cmdline box pops up, and it feels like a good experience, I want to ask how you did it

The plugin that does this is noice.nvim. It's not a telescope dialog (although it looks like it), it's a prompt for command mode in neovim.

this cool thanks

Uzaaft commented 1 month ago

I just tested with base v4 and typescript pack, no issues with eslint and prettier here

First of all, thank you, maybe you can try to open a nextjs project, configure eslint, then open the two ts files of the project, and then format the file to save one file, and modify the second file, at this time the save format will be wrong

Already done. Works fine for me.

taotao7 commented 1 month ago

I just tested with base v4 and typescript pack, no issues with eslint and prettier here

First of all, thank you, maybe you can try to open a nextjs project, configure eslint, then open the two ts files of the project, and then format the file to save one file, and modify the second file, at this time the save format will be wrong

Already done. Works fine for me.

Close it. I'm fine now after reconfiguring it according to my brother upstairs.

luxus commented 1 month ago

i wish i have a brother upstairs!