Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Support additional file types #9

Closed
apexskier opened this issue Sep 19, 2020 · 11 comments · Fixed by #22
Closed

Support additional file types #9

apexskier opened this issue Sep 19, 2020 · 11 comments · Fixed by #22
Labels
enhancement New feature or request

Comments

@apexskier
Copy link
Owner

https://discord.com/channels/756815974128418817/756817436363194401/756878326404087908

Currently, this extension is limited to only javascript, typescript, jsx, and tsx files. Eslint can operate on other types, such as vue, html, etc when used with plugins (see eslint/rfcs#20). This plugin should have parity with eslint's core features.

Unfortunately, since command applicable syntax is currently static in the extension manifest, this is "all or nothing" for commands and can't easily be user configured. We can support dynamic user configuration for inline functionality though.

VSCode's plugin appears to default to checking html and vue, so it's probably acceptable to do that here as well.

@apexskier apexskier added the enhancement New feature or request label Sep 19, 2020
@apexskier
Copy link
Owner Author

Slightly more complicated than I was expecting - merely adding html as a filetype breaks things (probably because it doesn't use the right parser). We might need something in the eslint runner to load configuration for a specific file (possibly through #10).

@tommasongr
Copy link

I would really like to give you a hand but I'm not aware of the big picture of ESLint, if I'll find time to give it a look I'll do my best to help on this! 💪

@tommasongr
Copy link

Hi @apexskier
I tried the branch with support of additional file types in a vue project and as far as I've seen it all works correctly! Do you still have problems on that??

@apexskier
Copy link
Owner Author

Last I tried this broke for html files in a non-vue project.

@tommasongr
Copy link

What kind of broke? I would like to try and see

@apexskier
Copy link
Owner Author

I'm seeing a parsing error in my test html file. (code is here)
Screen Shot 2020-09-24 at 20 49 51

@apexskier
Copy link
Owner Author

I found one issue (although I suspect there'll be another) - the uri passed to the eslint process doesn't work, since eslint isn't able to resolve file: uris to find the right config file.

@apexskier
Copy link
Owner Author

Fixed that, but the next issue is that parsing won't work unless you have the extension installed that sets up parsing for the custom file types (so you'll get warnings like this).

@apexskier
Copy link
Owner Author

It looks like the vscode extension might be checking configured plugins to determine file type support -https://github.com/microsoft/vscode-eslint/blob/31b3f27aaf6d6f9c47c7395f0cb5e976ed0e54cd/server/src/eslintServer.ts#L648

@soniktrooth
Copy link

soniktrooth commented Sep 30, 2020

Is this a 'closed won't fix'? I would love some es-lint happening in script blocks of .vue files.

@apexskier
Copy link
Owner Author

Nope, support has been added, see the linked PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants