Open LionyxML opened 2 years ago
@LionyxML We actually used tide
for .ts
and .tsx
and js2-refactor-mode
for js
. But really, we should be using those for both. I just haven't gotten around to it because I don't really do much .js
coding these days.
Would it be acceptable to put a jsconfig.json
in your project, and typescript language server in your package dependencies?
https://github.com/ananthakumaran/tide#javascript
If so, we could see if that file exists, and then load tide in stead of a vanilla JS environment.
GitHubTide - TypeScript Interactive Development Environment for Emacs - GitHub - ananthakumaran/tide: Tide - TypeScript Interactive Development Environment for Emacs
Hello again! Sorry to spam you guys like this. :D
Oh, and no need to apologize ever. Really appreciate ways that this can be improved.
Hello there!
I asked around about having a fallback for when jsconfig.json or tsconfig.json is not present into the directory, but I guess I am too dumb to understand the reason (lol).
In short. For projects I maintain, it is ok to do so. For projects I do not have any decision power, I will probably have to manage it locally.
I would love this feature, but I do not think it is for everyone (due to jsconfig mandatory presence), it might be some option to set in frontside custom-group.
Points to VSCode in this regard. If no config is present, it runs typescript in the background using its own defaults.
I asked around about having a fallback for when jsconfig.json or tsconfig.json is not present into the directory, but I guess I am too dumb to understand the reason (lol).
There are a couple of reasons.
1) on javascript projects, generally, there is no dependency on typescript
in package.json. As a result, you can't even start the tsserver because where is the actual js code to do so?
2) without a jsconfig.json
how can you know which typescript compiler options to use?
Maybe we can have defaults for these? Not sure how that could work...
Hello again! Sorry to spam you guys like this. :D
As I am more then happy editing a new .tsx / .ts project, but I happened to be maintaining some older JS code also.
And now emacs behaves differently. No auto complete and no docs over functions. I know VsCode made me spoiled by providing the same linting for both .js and .ts files, am I asking to much expecting it to behave the same?
Inside a .tsx file if I type
console.
I get the following suggestions:The same if the file is a .ts:
But inside a .js (also jsx) file:
My modes:
Inside JS(X) files:
Inside TS(X) files:
For comparison, on both js(x) and ts(x) inside VSCode: