-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for eslint #308
Comments
I am ok with 2 and 3. about 1 could you explain how would you figure out if the user is planning to use Personally, I don't like the fact that tide has to be responsible for setting the correct next checker. We had the discussion about the same issue before and finally agreed to set next checker.
but apparently it's confusing others as well. But, I don't have any good alternative solution either for the issue. |
Disregarding everything else about this issue, I can really sympathize with this, and it's been a thought I've been having for a good while. Once Emacs and LSP works properly, why should we bother maintaining a separate LSP client, just specifically for TypeScript? When I checked the state of affairs with Emacs and LSP last year, it was quite a joke. Recently though I've taken a look at it again (from a Rust-perspective) and it has improved immensely, to the point of me suspecting that whatever I was missing was actually due to incomplete support in the Rust Language Server, not Emacs. And once things get really good and just work out of the box, I would really expect most Emacs-users to prefer a "standard" LSP experience over some non-standard thingie like Basically at some point in the not too distant future I expect (hope?) Is that just me, or is anyone else also considering this future possibility? Which leaves me with some mixed feelings about investing too much extra effort into improving tide at this point. I'd rather help get "official" LSP-mode working flawlessly for TypeScript out of the box, than invest more in something soon to be obsolete. And when the time comes that LSP-mode is the obvious choice, I think it would make sense to port whatever we have which is tide-specific (and not bound to LSP) into basic TypeScript mode. Is this something anyone else thinks we should look into? Or is it just me? (Also: Should this be discussed in a separate issue on its own?) |
I agree, in the long run, LSP is the way to go. Then the question is mostly when?. I have been using LSP for other languages and the emacs client has improved a lot in recent days, but the server implementations are not up to par with tsserver. I have been using elixir lsp where even jump to definition breaks randomly. If TypeScript officially switches to lsp, then we can deprecate this package. Visual Studio Code probably has the exact same problem, they use tsserver but also support lsp for other languages I believe. |
What I have in the first post is a wish list. I've not put any thought into the details of how it would be implemented. I start from the position is that I filed the issue because that's likely to become a pressing issue if no work is done towards supporting And I agree with what was expressed regarding LSP vs Tide. |
I'd like to see elsint with tide on my TS. |
Silly question, but what's tide is doing with tslint? Why there is need from tide's side to eslint while we have flycheck? Except for |
@mk0x9 We have things like this:
The |
Projects will often include a lint step as part of their continuous integration. if this is the case, it's convenient to display the errors that will cause your build to fail in emacs.
https://medium.com/palantir/tslint-in-2019-1a144c2317a9 |
so how would I configure (flycheck-add-next-checker 'typescript-tide 'javascript-eslint 'append) however, I don't manage to configure this through my emacs config. I tried adding that line as-is, but it didn't work, nor did this, trying to tie it to the major mode through a hook: (add-hook 'typescript-mode
(lambda ()
(flycheck-add-next-checker 'typescript-tide 'javascript-eslint 'append)))
(add-hook 'typescript-mode
(lambda ()
(flycheck-add-next-checker 'tsx-tide 'javascript-eslint 'append))) so how could I configure this? Thank you! |
@emmanueltouzery The way I have it in my .emacs file I run the By the way, I've been working on adding eslint support to tide. I've got point 2 of my list of points in the original post pretty much done. I've yet not done much regarding point 1, other than getting a configuration that WorksForMe(tm) but is probably not general enough. |
@lddubeau thanks for the feedback! Looking forward to builtin support in tide. For now I made it work in my case: ;; https://github.com/hlissner/doom-emacs/issues/1530#issuecomment-507653761
(add-hook 'typescript-mode-local-vars-hook
(lambda ()
(flycheck-add-next-checker 'typescript-tide 'javascript-eslint 'append)))
(add-hook 'typescript-mode-local-vars-hook
(lambda ()
(flycheck-add-next-checker 'tsx-tide 'javascript-eslint 'append))) i use doom-emacs so I don't have complete control when things get loaded. -local-vars-hook is a doom-emacs thing. |
I've been using my code for a while with a mixture of projects, with various scenarios. I've run into some complications, and I'm having some doubts as to whether and to what extent this project should tackle what I had identified as points 1 and 3 in my original post:
There are two complications:
|
While maybe not unlimited, it's clearly non-zero and more than one. And that's when we're not even accounting for which versions are in use. Even linters have breaking changes across major versions every now and then.
Which in some cases makes perfect sense, at least for errors reported by But... for linters?
I don't have the experience to either confirm or contradict this... But wouldn't it make more sense to move support for the linting bit into Because asking a question which can easily be googled is kinda of lazy, I decided to investigate that bit slightly, and I found this:
So ... In what ways are Shouldn't linting-related errors go to |
I meant that you cannot put an arbitrary limit on the number of linters that may be used for linting TS code. If you state "there are X linters for TypeScript", I can assure you it is only a matter of time before someone comes up with a new framework that spins its own linting tool wrapping around eslint.
In my experience the breaking changes across major versions have not been particularly challenging to handle. And the fixes where squarely on the flycheck side of the tide/flycheck dividing line of responsibilities.
Unless there's a major change in development philosophy from the dev(s) of flycheck, I don't see flycheck itself being the home for this. Getting the I've checked whether there's any desire to include in flycheck something that would do what It is true that a
In practice the actual support for tslint in flycheck is laughable. It works for toy projects, but as soon as it meets the real world, problems start surfacing:
I suspect eslint is better supported than tslint but I can foresee issues similar to those that happen with tslint recurring here too. In particular, I know for a fact that right now flycheck ignores the Node convention I mention above. I got it to work for me by writing an
They are already going to flycheck and no one is proposing otherwise. However, tide has not up to now taken a hands off approach when it comes to linters. Tide has already taken upon itself to provide support for a certain development setup, one which is no longer being maintained. Namely:
Letting users figure out how they need to configure flycheck is fine but, then in my opinion, if that's the approach adopted, tide should do nothing more than define the checkers it needs to report I think |
Thanks for the thorough and detailed reply @lddubeau. Greatly appreciated. The current situation (at least from a code-sanity perspective) honestly sounds about as sad and depressing as it could possibly be. So if I understand things correctly:
If that understanding is anywhere near accurate I propose:
While I think sounds like more work for end-user, it sounds like a much more composable solution, and not to mention a solution where it will be easier for end-users to put together a working solution for their own projects, and have it keep working. Agreed? Or any objections? |
@josteink I agree. I would prioritize the dedicated Also, it is still unclear to me what form the support for TS linters should take in the long run. In other words, whatever I'd send to upstream would feel more experimental than I'd like. Which could prove another obstacle in the short term to pushing changes upstream if the people evaluating the changes also find them too experimental. Of course, nothing prevents having both |
Seems that the road is establish to convey on As an update, is worth talking about a plan to facilitate a migration? |
I noticed that tslint has been removed in #413 🎉. Going back to the original issue, would now be a good time to address point no.2? This function is unbelievably helpful.
|
I guess that leaves you @lddubeau to be a man of your word? 😄 |
Here's the situation. I'm dealing with a serious health condition that has
taken me out of rotation since June 2020, and will probably continue until
November 2021. I can read emails but I have not gone back to working on
github yet.
It's hard to tell when I'm going to be back to my old self since I still
have one major operation to undergo in April. They say 6 months recovery
time but I suppose I'll be able to get back to giihub earlier than that.
The 6 months figure includes physical activity for instance. But I cannot
tell when that will happen.
I wouldn't be offended if you all decided to move forward without me.
…On Mon, Mar 1, 2021 at 2:45 AM Jostein Kjønigsen ***@***.***> wrote:
1. Provide an eslint equivalent to tide-add-tslint-disable-next-line.
(I actually already have code for this.)
I guess that leaves you @lddubeau <https://github.com/lddubeau> to be a
man of your word? 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#308 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAO7LZPYUA4GLDFAO3ZJXMLTBNAZBANCNFSM4HAGPWFA>
.
|
Take care of yourself and take your time. Certainly do NOT worry about silly GitHub issues! 😆 I hope all goes well and wish you the speediest of recoveries! ❤️ |
Take care @lddubeau! |
Thanks guys! |
I guess that means that if anyone else wants to take a stab at this, any PR is greatly welcomed :) |
However, Is updating that documentation (assuming it actually works as well as it initially appears to) all that is left of this issue, or have I missed something? |
Currently, tide provides support for linting with
tslint
but not for linting witheslint
. It turns out that linting TypeScript code witheslint
is already a thing. (I did not realize that. I useeslint
but only for JS code, and I exclusively usetslint
for TS code.)I think adding support for
eslint
now would be an enhancement, but it appears thattslint
will eventually be deprecated. (See microsoft/TypeScript#29288.) So eventually the lack of support foreslint
will be a bug.I see 3 areas of concern:
When
eslint
is to be used for linting, sequence theeslint
-based checker to run aftertypescript-tide
andtsx-tide
like we do withtypescript-tslint
.Provide an
eslint
equivalent totide-add-tslint-disable-next-line
. (I actually already have code for this.)Update the documentation to explain how to use
eslint
with tide. (The equivalent of what we already have fortslint
.)The text was updated successfully, but these errors were encountered: