-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Update dependencies to latest version + add ts-standard linting rules #132
Update dependencies to latest version + add ts-standard linting rules #132
Conversation
Looks good so far! Thank you for taking on this task, @divlo. Can we please do this in stages? It will be a lot easier to review changes if we don't mix formatting changes with code changes. If they're mixed together, it's too hard to review the code changes. I'd like to land this PR since it already improves things quite a bit. Would you like to get it into a mergeable state and then focus on the rest in additional PRs? |
Right, doing multiple pull requests instead of big one will be lot easier to review. The real problem with this pull request is that in its current state, I installed Also before merging this PR to master, I still need to check that nothing break, I only tested with For the next tasks, I'll definitely do smaller pull request. |
This is looking really good so far!
Feel free to fix it in this PR. As long as you do it in a separate commit, I can just review it separately from the rest of the commits. Once you've done that and tested the changes, can you unmark this as a draft? Then I'll merge.
Yep, looking forward to your future PRs where you add testing 🤞 |
@divlo Your latest changes look good. Let me know when you're ready to merge this by unmarking it as a draft PR. |
Thanks for your support @feross! 😀 It's a tedious and repetitive work to fix one by one linting errors on a project while taking into account that everything should work same way as before. It doesn't really improve the extension itself (doesn't add features or fix bugs) but it will be easier to maintain later on, catch style issues and programmers errors early, as it's one of the goal of Current PR state: There are still lint errors thrown by
I will try to fix more of those this weekend. Anyone feel free to add commits to this PR and help to fix lint errors by running |
@divlo Thank you for doing this work – as a newly converted VSCode user, I seriously appreciate it. 👍 If you want to split up this work, we could remove |
@LinusU @toddbluhm Feel free to help to fix the linting errors, so we can merge this to I have trouble fixing some linting errors since I didn't write the code so I need to understand how the code works before changing something. @feross I guess now that we started to do the linting work, we should finish it. Current PR state (errors thrown by
There were issues with this rule : https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md |
@LinusU @toddbluhm I would be super grateful if you could help @divlo with this PR! I'm not very experienced with TS, so I'm struggling to review some of these changes. If we can land this PR soon then the VSCode editor plugin will be back in a "maintained" state and 300k users will be super grateful :) Eager to improve things! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know might be an issue with ts-standard or eslint, should we ignore them with a comment like eslint-disable-next-line or any other workaround ?
Yes, feel free to use an ignore comment if the linter seems to have a bug.
The 4th error, folder will evaluate to [object Object] when stringified is a real error but I don't know what the code should do there, since we're mapping trough an array of folders to stringify them but what property of that object should we use or should we simply use JSON.stringify?
@LinusU @toddbluhm Do you have any idea what might have been intended here?
Last error, is because I did an async function inside a callback to use await keyword so I don't have the lint error no-floating-promise but the callback should return void, now since it's an async function, it returns Promise, that's why it's complaining, in both cases I've got a lint error.
You can fix this issue by keeping the outer function as a normal non-async function, and make a IIFE async function inside so you can use the await
keyword. Something like this:
function () {
;(async function () {
await somePromise()
...
})()
}
Good news, I fixed all the linting errors. 🎉 I packaged the extension and tested it, on one of my project and everything seems to work same way as before, my project use {
"standard.enable": true,
"standard.usePackageJson": true,
"standard.engine": "ts-standard"
} Hopefully, I didn't break anything, we should also test with different engines and different settings to make sure everything works. Regarding how I fix the errors : I tried my best to avoid using In my opinion : we could decrease this number and improve further the code quality in future PRs, but as it is now we could just ignore these errors and merge that PR to master, do you think it's a viable option ? Also, if you like my work, I would be happy to maintain this vscode extension (if you could add me to the org). So I can manage issues and review PRs and we can continually improve the extension as I (and hopefully 300k users too) also enjoy using this extension in projects. 🚀 |
@divlo I took a look at those The As for the |
Incredible work, @divlo! I and the whole @standard/team appreciate this massive effort to bring this extension back into maintenance! You're awesome! 🤩 I'll merge this PR now! Before I cut a release, I'd like at least 5 VSCode users to run the code on |
I opened an issue seeking testers before we publish the new version: #135 |
The purpose of this pull request (and checklist)
ts-standard
linting rulesvscode
field in thepackage.json
to^1.50.0
(instead of^1.16.0
)npm run lint
script to run with ci integration (travis here)ts-standard
Description
This is a huge pull request with lot of changes since the code is very old and outdated (
package-lock.json
changes for example), especially since this pull request will followstandard
rules, no 4 spaces, no semicolons for example.Which issue (if any) does this pull request address?
closes #130 , closes #124, closes #125, closes #133