Improve semicolon detection experience for new files #32831
Labels
Experience Enhancement
Noncontroversial enhancements
Fix Available
A PR has been opened for this issue
Suggestion
An idea for TypeScript
Milestone
TypeScript Version: 3.6.0-dev.20190810
Search Terms:
Repo
For a very simple project:
tsconfig.json
constants.ts
main.ts
main.ts
ona
Expected behavior:
Since
constants.js
does not use semicolons, the import should not have a semi colonActual 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
/cc @andrewbranch
Related Issues:
The text was updated successfully, but these errors were encountered: