reformat code for TypeScript according to code style

已回答

I have enabled the setting, but when I format code, space not correct 

 

I think this setting only takes effect on function, not on yield?

If so, is there a similar rule-setting for yield?

0

There are no separate settings for yield*, After '*' in generator and Before '*' in generator options should affect it (and it works for me)

Do you have .editorconfig file anywhere in your project? Also, do you have Prettier enabled in Settings | Languages & Frameworks | JavaScript | Prettier and used for code reformatting?

0

The hotkey of prettier is different from the format code, so it cannot be caused by prettier.

format code is ⌥  ⌘ L

prettier is ⌥  ⇧ ⌘ P

 

The current scenario is that when I operate the format shortcut key, the space problem appears

0

>The hotkey of prettier is different from the format code, so it cannot be caused by prettier

Since 2020.2, Prettier can be run on ⌥ ⌘ L if On code reformat option is enabled in Prettier settings.

What about .editorconfig ?

0

The above problem also occurred in the previous version, so I think it is not a prettier problem.

 

I did a test, when I delete and disable editor config, the question again.

So I think it's IDEA bug.

 

 

0

it's not repeatable for me

Can you reproduce it in a new project?

0

请先登录再写评论。