You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve semicolon detection experience for new files #32831
Expected behavior:
Since constants.js does not use semicolons, the import should not have a semi colon
Actual behavior:
The added import has a semi colon
I believe this is because the current semicolon detection logic (#31801) requires some number of examples in the current file to learn from. For new files, this means we always default to using semicolons even if the rest of the project is semicolonless
I can understand why we do this, but as a user I found it frustrating that TS would still insert semicolons until I added a certain number of imports (or other statements that are also used by the detection code). I don't know if looking at the rest of your project code is feasible or not for semicolon detection but we should discuss if we can improve the experience for new files
The better solution may be to add an explicit preference for semicolons, similar to one we already have for quotes. Trying to infer if semicolons should be used or not from other files in the project could be messy and prone to errors
Activity
mjbvz commentedon Aug 15, 2019
The better solution may be to add an explicit preference for semicolons, similar to one we already have for quotes. Trying to infer if semicolons should be used or not from other files in the project could be messy and prone to errors