Skip to content

Commit

Permalink
fix(tslint): enhance replace handling to differentiate between insert…
Browse files Browse the repository at this point in the history
…, delete, and replace actions
  • Loading branch information
johnsoncodehk committed Jan 5, 2025
1 parent d937118 commit 5a760de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/tslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export function convertRule<T extends Partial<TSLintRule> | TSLintRule>(
for (const replace of replaces) {
if (replace) {
reporter.withFix(
'Replace with ' + replace.text,
replace.length === 0
? 'Insert ' + replace.text
: replace.text.length === 0
? 'Delete ' + replace.start + ' to ' + replace.end
: 'Replace with ' + replace.text,
() => [{
fileName: sourceFile.fileName,
textChanges: [{
Expand Down

0 comments on commit 5a760de

Please sign in to comment.