(WIP) Use @volar-plugins/eslint
instead of ESLint VSCode Extension
#2204
Replies: 7 comments 17 replies
-
Did you make a typo here or something? I'm fairly sure that the eslint server doesn't use typescript (which I guess is what you are referring to by "TS Program") for anything.
This is listed as an advantage over eslint extension but eslint extension can also be easily configured to lint Appreciate the work of course. Just wanted to clarify some points. |
Beta Was this translation helpful? Give feedback.
-
I think we need to support
It's not correct for me know.
This config is work well in my exp.
The standalone ESLint VSCode Extension is work better than reuse sometimes. The last, thanks. this is amazing.
With this package, we have the opportunity to support template type information linting. cc @ota-meshi by |
Beta Was this translation helpful? Give feedback.
-
I do not speak English so I do not know if I am writing this well but let me comment. Also because I am busy right now I have not tried Related to the story @yoyo930021 wrote in the issue, I experimented with passing a special TS Program instance to However, eslint-plugin-vue has supported using the ASTs generated by vue-eslint-parser to check the writing style of templates according to user preferences. I am concerned that perhaps it would be difficult to fully support these with the current Volar mechanism. To begin with, vue-eslint-parser is not designed to accept type checking for template blocks. This is by far the inferior part compared to This has nothing to do with They had some success, but I still think a Volar-generated TS Program instance is a must to do the same thing for *.vue. I still have no idea for vue-eslint-parser and |
Beta Was this translation helpful? Give feedback.
-
I think that implementing a whole new ESLint LSP is going to be a really bad route to go. If you spend just a moment looking at vscode-eslint you'll see why - it is really, really robustly built, provides a lot of features, and handles a lot of edge-cases. Building another version of it is just asking for maintenance pain and additional pain for your users as they find they're missing features. For example - quickly browsing the That way users don't have to choose between your integrated solution and a feature rich solution - they can just use your solution without any trade-offs. It also would open the door for other IDEs to provide the same feature-rich experience that VSCode has with ESLint - so it's a huge win-win! |
Beta Was this translation helpful? Give feedback.
-
To be clear - there shouldn't really be any raw performance wins here - volar manages a The biggest benefits of using a single
Though it's worth noting that without the CLI tools you mentioned above - you're probably creating a net worse experience for users because they need to maintain an ESLint config AND a volar config, and they may get two different ESLint results - one in their IDE and one from their CLI. There's a lot of pros and cons to both approaches, but unless you're going to build a more complete solution so that a user knows that what they see in their IDE will always match what is output from their CLI tools (i.e. what is run against their PRs in their CI) - you're probably just going to be creating a worse and confusing experience for people. |
Beta Was this translation helpful? Give feedback.
-
Closed due to the immaturity of the current solution, even it is currently works, it requires too much user setup (volar.config.js, vue-tsc hook). We will find a more user-insensitive way to implement it in Volar.js 2.0 with Monoserver and Rules API. |
Beta Was this translation helpful? Give feedback.
-
It looks like this stagnated in February, are there any updates on this? |
Beta Was this translation helpful? Give feedback.
-
@volar-plugins/eslint is a Volar LangaugeServicePlugin that support uses ESLint in Volar / Vue Language Server. With this plugin, you can have much better Linting performance in VSCode.
Why
@volar-plugins/eslint
performance is better?One of the reasons why ESLint VSCode Extension is slow is that it manages a very expensive TS Program instance that create from TypeScript ESLint plugin, which requires a lot of calculations every time you edit a document.
However, Volar Language Server already has a TS Program, so we can reuse it to avoid repeated calculations.
Other advantages
volar
together with@typescript-eslint/parser
for type checking rules to understand SFC component types #2189)<template>
,<style>
,<script>
from .vue files, which has disabled in sample setup, but you can try removeignorePatterns: ['**/*.vue.*']
to use as your need.Usage
@volar-plugins/eslint
to your projectHow about CLI?
This plugin only affects IDE, and will not affect CLI.
Problems
It don't support
Fix All
for now, because I've gotten a lot of complaints in this repo in the past about slow document saving from ESLint'sFix All
behavior, we will add it when I have confirm the plugin doesn't cause this problem. (Please open a feature request to https://github.com/johnsoncodehk/volar-plugins/issues if you want to.)Update: Migrate fromvue-eslint-parser
Outdated content
@volar-plugins/eslint
cannot work well witheslint-plugin-vue
,because we cannot pass the TS Program to, but due totypescript-eslint/parser
ofeslint-plugin-vue
@volar /vue-language-server
already parses .vue to .vue.ts and feeds to@volar-plugins/eslint
, so we don't needeslint-plugin-vue
to already be able to support linting for<script>
block.This PR shows how migrate from
vue-eslint-parser
to@volar-plugins/eslint
.We will going to support
vue-eslint-*
, please track DrJume/vue-volar-eslint#1Beta Was this translation helpful? Give feedback.
All reactions