-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
"Format Code" causes tslint failure with type assertions #10296
Comments
Format Code is provided by |
I guess the easiest fix might just be to not include the |
@dbaeumer agreed, this is really a feature request for the TS formatter to support an option to have a space after a cast operator. |
So how should I/we proceed? |
@LOZORD best is to open a feature request for the formatter here: https://github.com/Microsoft/typescript |
Could someone please let me know how to activate this in vscode? I do not get the expected results when putting this into my settings:
|
@mjbvz is this support already. Looks like TS merged a PR for this but we don't have a setting for this yet in VS Code. |
This formatting option doesn't seem to be in the TSServer protocol yet. Adding it is being tracked by microsoft/TypeScript#14661 |
@csentis clone typescript repo in ad folder (i will call it FOLDER)
in FOLDER/lib/tsserver.js at line 68794
restart vscode Note: recall to restore typescript.tsdk rule when tsserver will be updated |
This should be in TS 2.4: microsoft/TypeScript#14661 Added to the June plan |
@mjbvz if I read the June Iteration Plan properly, this has been deferred. Can you correct me? |
@csentis Thanks for the reminder. This should be in for June with TS 2.4 |
@mjbvz Thank YOU |
@mjbvz with TS 2.4.1, |
@roblourens The change went in pretty recently and isn't in the current insiders build. Can you try a build from master? The next insiders should also have this change |
Oops, didn't notice the timestamp |
Verified the setting exists and works as expected. |
From @LOZORD on August 5, 2016 3:14
If I have code like this:
and then "Format Code" (alt-shift-F on Mac), I get this:
The missing space after the closing angled bracket causes a spacing failure with tslint. I removed the settings in my
.vscode/settings.json
that have to do with JS/TS spacing, and the error still occurred. Is there something else I can configure to solve this?Copied from original issue: Microsoft/vscode-tslint#69
The text was updated successfully, but these errors were encountered: