1

I want to integrate Prettier / ESLint with the new JetBrains IDE Fleet, but I can't find out a way to do this. In this documentation it says that it can be integrated with EditorConfig, but I'm not sure how to achieve this with EditorConfig.

Is it currently not supporting Prettier? Thanks!

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Sam Zhang
  • 320
  • 4
  • 17
  • *"In this documentation it says that it can be integrated with EditorConfig"* **I believe** you read it wrong. What is says there is that Fleet can use `.editorconfig` files to read code formatting rules. That includes [standard properties](https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties) + rules when you do [export of the JetBrains Code Style into `.editorconfig` file](https://www.jetbrains.com/help/webstorm/configuring-code-style.html#editorconfig)/or manually add them there (they will have `ij_` prefix and are specific to JetBrains IDEs). – LazyOne Oct 16 '22 at 10:38
  • I see no mentions of Prettier in Fleet docs yet. This means that the IDE does not have an automatic (built-in) way of executing Prettier for your just-saved file (like it works in WebStorm or other JetBrains IDEs -- https://www.jetbrains.com/help/webstorm/prettier.html ). But I think it will be supported at some point as it's a very popular tool (well, both Prettier and ESLint) -- be it direct support from JetBrains or via custom plugin (once they will add a public support for plugins). – LazyOne Oct 16 '22 at 10:41
  • Run Prettier on Save: https://youtrack.jetbrains.com/issue/FL-14036 – LazyOne Oct 16 '22 at 22:28
  • But in general: this [FL-10430 ticket](https://youtrack.jetbrains.com/issue/FL-10430) tells that Prettier should be used by default for JS and TS files. See the first comment there. – LazyOne Oct 16 '22 at 22:30
  • 1
    ESLint -- should also work. From https://youtrack.jetbrains.com/issue/FL-12432 -- *"ESLint is expected to work, it's enabled automatically if it's configured in your project (has `eslint` package installed and for example, has `.eslintrc.js` file). Basically, if WebStorm automatically enables ESLint check and highlights error without additional configuration after opening a project for the first time (i.e. the project doesn't have .idea folder), Fleet enables it too. Though now I see some problems, and ESLint is not started sometimes." – LazyOne Oct 16 '22 at 22:32
  • This one ( https://youtrack.jetbrains.com/issue/FL-14035 ) asks about running `eslint --fix` on file save. – LazyOne Oct 16 '22 at 22:33

3 Answers3

1

On version 1.18 prettier worked for me. Fleet doc

I setup prettier and enabled format on save enter image description here

niltonxp
  • 342
  • 4
  • 11
0

Fleet does not have plugins support (screenshot from fleet preview), so u need to wait for it

Fusted
  • 1
  • 1
  • 1
    Regrading plugins -- sure (https://stackoverflow.com/questions/74070390/installing-plugins-in-jetbrains-fleet). But that's for 3rd party. They do have internal plugins. It is just not yet polished enough (WIP -- Work In Progress) to be announced as "properly supported". – LazyOne Oct 27 '22 at 09:44
0

Prettier is supported: FL-10430 Support formatting with Prettier

It should work out of the box with no additional configuration if it is configured for the project.

But there was an issue in 1.9 Fleet version that caused Prettier not working which will be fixed in 1.10 Fleet version.

Andrey
  • 15,144
  • 25
  • 91
  • 187