vetur icon indicating copy to clipboard operation
vetur copied to clipboard

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

Open muou2125 opened this issue 2 years ago • 18 comments

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

muou2125 avatar Feb 21 '23 06:02 muou2125

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

yoyo930021 avatar Feb 21 '23 07:02 yoyo930021

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

Any item

bailuochen avatar Feb 21 '23 08:02 bailuochen

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?

yoyo930021 avatar Feb 21 '23 08:02 yoyo930021

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

jordibreuls avatar Feb 21 '23 14:02 jordibreuls

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

Twisted101 avatar Feb 22 '23 03:02 Twisted101

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

jun1orDev avatar Feb 22 '23 19:02 jun1orDev

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

https://github.com/muou2125/Vetur_issues

muou2125 avatar Feb 23 '23 03:02 muou2125

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 avatar Feb 23 '23 03:02 muou2125

Any item

https://github.com/muou2125/Vetur_issues

muou2125 avatar Feb 23 '23 03:02 muou2125

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.

yoyo930021 avatar Feb 23 '23 06:02 yoyo930021

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).

jordibreuls avatar Feb 23 '23 08:02 jordibreuls

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.

yoyo930021 avatar Feb 23 '23 09:02 yoyo930021

已经影响了正常使用,版本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 avatar Feb 23 '23 09:02 15844229646

@muou2125

15844229646 avatar Feb 23 '23 09:02 15844229646

已经影响了正常使用,版本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.

yoyo930021 avatar Feb 23 '23 10:02 yoyo930021

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"]

speyou avatar Feb 23 '23 18:02 speyou

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

Vansinnesvisor avatar Mar 09 '23 08:03 Vansinnesvisor

NO MORE MEANINGLESS +1. Just click the reactions.

so1ve avatar Apr 01 '23 18:04 so1ve