Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新到最新版本0.37.2,保存时 [object Promise] #3653

Open
muou2125 opened this issue Feb 21, 2023 · 18 comments
Open

更新到最新版本0.37.2,保存时 [object Promise] #3653

muou2125 opened this issue Feb 21, 2023 · 18 comments

Comments

@muou2125
Copy link

muou2125 commented Feb 21, 2023

更新到最新版本 0.37.2,保存代码直接把script里的代码变成 [object Promise]了,安装回0.36.1保存正常
示例仓库:https://github.com/muou2125/Vetur_issues
image

@muou2125 muou2125 changed the title 更新到最新版本,保存时 [object Promise] 更新到最新版本0.37.2,保存时 [object Promise] Feb 21, 2023
@yoyo930021
Copy link
Member

Please provide a repro case.
https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

@bailuochen
Copy link

Please provide a repro case. https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

Any item

@yoyo930021
Copy link
Member

yoyo930021 commented Feb 21, 2023

Please provide a repro case. https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

Any item

I can't repro it in my any project.
Please provide your case and more information.
Do you have use Typescript? Version?

@jordibreuls
Copy link

Same issue here since upgrading to 0.37.(2)!

2 similar comments
@Twisted101
Copy link

Same issue here since upgrading to 0.37.(2)!

@jun1orDev
Copy link

Same issue here since upgrading to 0.37.(2)!

@muou2125
Copy link
Author

@muou2125
Copy link
Author

Please provide a repro case. https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

Any item

I can't repro it in my any project. Please provide your case and more information. Do you have use Typescript? Version?

https://github.com/muou2125/Vetur_issues

@muou2125
Copy link
Author

@yoyo930021
Copy link
Member

The new prettier-eslint only work with ESLint 8.
https://github.com/prettier/prettier-eslint/releases

You can install your prettier-eslint in project and set vetur.useWorkspaceDependencies: true.
Or upgrade eslint to v8 in your project.

@jordibreuls
Copy link

The new prettier-eslint only work with ESLint 8. https://github.com/prettier/prettier-eslint/releases

You can install your prettier-eslint in project and set vetur.useWorkspaceDependencies: true. Or upgrade eslint to v8 in your project.

Hey @yoyo930021, thanks for your time. What exactly are you suggesting? This is not a Vetur issue and we should install prettier-eslint? All our developers have this issue and we would like to apply the solution on project level, not user level (in other words, not using the Vetur useWorkspaceDependencies option).

@yoyo930021
Copy link
Member

The new prettier-eslint only work with ESLint 8. https://github.com/prettier/prettier-eslint/releases
You can install your prettier-eslint in project and set vetur.useWorkspaceDependencies: true. Or upgrade eslint to v8 in your project.

Hey @yoyo930021, thanks for your time. What exactly are you suggesting? This is not a Vetur issue and we should install prettier-eslint? All our developers have this issue and we would like to apply the solution on project level, not user level (in other words, not using the Vetur useWorkspaceDependencies option).

You have two workarounds.

  1. install your prettier-eslint in project and set vetur.useWorkspaceDependencies: true.
  2. upgrade eslint to v8 in your project.

For Vetur there is actually no good way. At most, there is a warning.
Vetur can't directly use eslint 8, because Vetur doesn't know eslint 8 work in your eslint config.
I can't choose not to update prettier-eslint either, so specifying the version you are using directly is the best way.

@15844229646
Copy link

已经影响了正常使用,版本0.37
复现代码:http://u5n.cn/4t78Q

另外,不能强制用户使用 eslint

Normal use has been affected, version 0.37
Recurrence code: http://u5n.cn/4t78Q

In addition, users cannot be forced to use eslint

@15844229646
Copy link

@muou2125

@yoyo930021
Copy link
Member

yoyo930021 commented Feb 23, 2023

已经影响了正常使用,版本0.37
复现代码:http://u5n.cn/4t78Q

另外,不能强制用户使用 eslint

Normal use has been affected, version 0.37
Recurrence code: http://u5n.cn/4t78Q

In addition, users cannot be forced to use eslint

Vetur 沒有強制使用者用 ESLint
甚至預設值 format script 區塊的 formatter 是 prettier 而非 prettier-eslint.
自己調整不能怪專案吧 ......

Vetur doesn't forced to use eslint.
You can use prettier formatter with script block.
Vetur deafult setting is prettier not prettier-eslint.

@speyou
Copy link

speyou commented Feb 23, 2023

Same problem on my old Vue2 codebase, I had to do the following in order to fix:

package.json

    "prettier": "2.x",
    "prettier-eslint": "6.x",

VSCode config (not sure if needed)

  "vetur.useWorkspaceDependencies": true, 
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  },

And since it seems to have forced the trailing commas on my lint, I added this as well:

.eslintrc

"comma-dangle": ["error", "never"]

@Vansinnesvisor
Copy link

Same issue, v0.36.1 works well.
Vue2, no typescript.

@so1ve
Copy link
Member

so1ve commented Apr 1, 2023

NO MORE MEANINGLESS +1.
Just click the reactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

11 participants