-
Notifications
You must be signed in to change notification settings - Fork 13
Fix: TypeScript Code Organizer Deletes Commented-Out Code (#107) #119
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| # organize code | ||
|
|
||
| tsco --organize | ||
|
|
||
| # format code | ||
|
|
||
| eslint | ||
| npx eslint |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -30,7 +30,7 @@ export class SourceCodePrinter | |||||
| { | ||||||
| // #region Public Static Methods (1) | ||||||
|
|
||||||
| public static print(fileHeader: string | null, nodeGroups: ElementNodeGroup[], configuration: Configuration) | ||||||
| public static print(fileHeader: string | null, nodeGroups: ElementNodeGroup[], fileTrailer: string | null, configuration: Configuration) | ||||||
| { | ||||||
| const printedSourceCode = this.printNodeGroups(nodeGroups, configuration); | ||||||
|
|
||||||
|
|
@@ -42,9 +42,21 @@ export class SourceCodePrinter | |||||
| printedSourceCode.removeConsecutiveEmptyLines(); | ||||||
| printedSourceCode.trim(); | ||||||
|
|
||||||
| if (printedSourceCode.length > 0) | ||||||
| const hasContent = printedSourceCode.length > 0; | ||||||
| const hasTrailer = fileTrailer && fileTrailer.length > 0; | ||||||
|
||||||
| const hasTrailer = fileTrailer && fileTrailer.length > 0; | |
| const hasTrailer = (fileTrailer?.length ?? 0) > 0; |
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.
The method should have an explicit return type annotation. Add
: string | nullto match the documented return type in the JSDoc.