Can we get a basic working eslint config into Helix by default? Discussion on what it should be... #8452
Replies: 4 comments 5 replies
-
I totally agree, great point. Should't we also include prettier here? Since Eslint + Prettier is pretty much the combo everyone uses? |
Beta Was this translation helpful? Give feedback.
-
Thanks for opening this discussion, I would love for Helix to provide some web dev capabilities out of the box at some point. I created an example NextJS project which is correctly configured for Typescript + ESLint + Prettier/dprint and a corresponding Helix config which you can find here: https://github.com/morlinbrot/helix-webdev-config (I never new if it was Helix or the project not being configured correctly). I wanted to share it here as a reference for the discussion and would be happy to update it to eventually arrive at something that could be considered a default Helix web dev config. It is building on @Philipp-M's original config (but simplified) and @David-Else's minimal set of options for the ESLint langserver. Unfortunately, I did not yet get ESLint auto-formatting to work. It's mostly fine for me because dprint is taking care of most auto-formatting but there are some things that ESLint will lint but not auto-format, for example:
The missing comma in the middle is being detected by ESLint but not auto-formatted and this also keeps dprint from adding a semicolon on the last line. My config is slightly different from @David-Else's but both are not working for me. According to the docs, these options should make it work:
(Btw, @David-Else, you have a typo in your config, it's Does anybody have a working, auto-formatting |
Beta Was this translation helpful? Give feedback.
-
I also tried digging into this; it seems like |
Beta Was this translation helpful? Give feedback.
-
I thought this was already fixed in 24.7, because of this: Lines 202 to 222 in 35f1c2a So I added it to the Wiki, but I've noticed it doesn't work, so I simply linked back to this discussion |
Beta Was this translation helpful? Give feedback.
-
JS is probably the world's most used language now, and everyone that uses it will probably want to use ESlint. It is installed by default with the https://github.com/hrsh7th/vscode-langservers-extracted package that contains our defaults for CSS, HTML and JSON.
Now we have multiple language server support I propose we should have working defaults built in so users can easily add things like ESLint if they want.
The best source I have found for setting ESLint up is @Philipp-M 's excellent #2507 (comment) (@cd-a had some great input in the thread) which I have boiled down to:
Then the user can add it easily:
The references to what these settings are doing is all at https://github.com/microsoft/vscode-eslint#settings-options. The lines I have commented out seem to be optional, but I could be mistaken. Can we agree on what is the bare most unopinionated settings to get it working and add it to Helix by default? It would save people from the config hell that Helix is trying to deliver them from :)
Beta Was this translation helpful? Give feedback.
All reactions