Commit 802dc2b
Andy
fixUnusedIdentifier: If every VariableDeclaration is unused, remove the VariableStatement (microsoft#24231)
1 parent d2f6f6a commit 802dc2bCopy full SHA for 802dc2b
11 files changed
+129-63Lines changed: 129 additions & 63 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src
- compiler
- services/codefixes
- tests
- baselines/reference
- cases
- compiler
- fourslash
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+47-24Lines changed: 47 additions & 24 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
22620 | 22620 | |
22621 | 22621 | |
22622 | 22622 | |
22623 | | - |
22624 | | - |
22625 | | - |
22626 | | - |
22627 | | - |
22628 | | - |
22629 | | - |
22630 | | - |
22631 | 22623 | |
22632 | 22624 | |
22633 | 22625 | |
| ||
22712 | 22704 | |
22713 | 22705 | |
22714 | 22706 | |
| 22707 | + |
22715 | 22708 | |
22716 | 22709 | |
22717 | 22710 | |
| ||
22731 | 22724 | |
22732 | 22725 | |
22733 | 22726 | |
| 22727 | + |
| 22728 | + |
| 22729 | + |
| 22730 | + |
| 22731 | + |
22734 | 22732 | |
22735 | 22733 | |
22736 | 22734 | |
| ||
22747 | 22745 | |
22748 | 22746 | |
22749 | 22747 | |
22750 | | - |
22751 | | - |
22752 | | - |
22753 | | - |
22754 | | - |
| 22748 | + |
| 22749 | + |
| 22750 | + |
| 22751 | + |
| 22752 | + |
| 22753 | + |
| 22754 | + |
| 22755 | + |
22755 | 22756 | |
22756 | 22757 | |
22757 | | - |
| 22758 | + |
22758 | 22759 | |
22759 | 22760 | |
22760 | 22761 | |
22761 | 22762 | |
22762 | | - |
| 22763 | + |
| 22764 | + |
| 22765 | + |
| 22766 | + |
| 22767 | + |
| 22768 | + |
| 22769 | + |
| 22770 | + |
| 22771 | + |
| 22772 | + |
| 22773 | + |
22763 | 22774 | |
22764 | 22775 | |
22765 | 22776 | |
22766 | 22777 | |
22767 | | - |
22768 | | - |
| 22778 | + |
| 22779 | + |
| 22780 | + |
| 22781 | + |
| 22782 | + |
| 22783 | + |
22769 | 22784 | |
22770 | 22785 | |
22771 | | - |
| 22786 | + |
| 22787 | + |
| 22788 | + |
22772 | 22789 | |
22773 | 22790 | |
22774 | 22791 | |
22775 | 22792 | |
| 22793 | + |
| 22794 | + |
| 22795 | + |
| 22796 | + |
| 22797 | + |
| 22798 | + |
| 22799 | + |
| 22800 | + |
| 22801 | + |
| 22802 | + |
| 22803 | + |
| 22804 | + |
22776 | 22805 | |
22777 | 22806 | |
22778 | 22807 | |
| ||
22781 | 22810 | |
22782 | 22811 | |
22783 | 22812 | |
22784 | | - |
22785 | | - |
22786 | | - |
22787 | | - |
22788 | | - |
22789 | | - |
22790 | 22813 | |
22791 | 22814 | |
22792 | 22815 | |
|
Collapse file
src/compiler/diagnosticMessages.json
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3556 | 3556 | |
3557 | 3557 | |
3558 | 3558 | |
| 3559 | + |
| 3560 | + |
| 3561 | + |
| 3562 | + |
| 3563 | + |
3559 | 3564 | |
3560 | 3565 | |
3561 | 3566 | |
| ||
3994 | 3999 | |
3995 | 4000 | |
3996 | 4001 | |
| 4002 | + |
| 4003 | + |
| 4004 | + |
| 4005 | + |
3997 | 4006 | |
3998 | 4007 | |
3999 | 4008 | |
|
Collapse file
src/services/codefixes/fixUnusedIdentifier.ts
Copy file name to clipboardExpand all lines: src/services/codefixes/fixUnusedIdentifier.ts+26-12Lines changed: 26 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
| 12 | + |
12 | 13 | |
13 | 14 | |
14 | 15 | |
15 | 16 | |
16 | 17 | |
17 | | - |
| 18 | + |
| 19 | + |
| 20 | + |
18 | 21 | |
19 | 22 | |
20 | 23 | |
21 | 24 | |
22 | | - |
| 25 | + |
23 | 26 | |
24 | 27 | |
25 | 28 | |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
26 | 33 | |
27 | 34 | |
28 | 35 | |
| ||
45 | 52 | |
46 | 53 | |
47 | 54 | |
| 55 | + |
48 | 56 | |
49 | 57 | |
50 | 58 | |
| ||
56 | 64 | |
57 | 65 | |
58 | 66 | |
59 | | - |
| 67 | + |
60 | 68 | |
61 | 69 | |
62 | 70 | |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
| 71 | + |
| 72 | + |
67 | 73 | |
68 | 74 | |
69 | 75 | |
| ||
74 | 80 | |
75 | 81 | |
76 | 82 | |
77 | | - |
78 | | - |
| 83 | + |
79 | 84 | |
80 | 85 | |
81 | 86 | |
82 | | - |
83 | | - |
| 87 | + |
84 | 88 | |
85 | | - |
| 89 | + |
86 | 90 | |
87 | 91 | |
88 | 92 | |
| ||
101 | 105 | |
102 | 106 | |
103 | 107 | |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
104 | 118 | |
105 | 119 | |
106 | 120 | |
|
Collapse file
tests/baselines/reference/unusedDestructuring.errors.txt
Copy file name to clipboardExpand all lines: tests/baselines/reference/unusedDestructuring.errors.txt+9-5Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | | - |
| 12 | + |
12 | 13 | |
13 | 14 | |
14 | 15 | |
| ||
24 | 25 | |
25 | 26 | |
26 | 27 | |
| 28 | + |
| 29 | + |
| 30 | + |
27 | 31 | |
28 | 32 | |
29 | 33 | |
|
Collapse file
tests/baselines/reference/unusedDestructuring.js
Copy file name to clipboardExpand all lines: tests/baselines/reference/unusedDestructuring.js+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | 12 | |
| ||
20 | 21 | |
21 | 22 | |
22 | 23 | |
| 24 | + |
23 | 25 | |
24 | 26 | |
25 | 27 | |
|
Collapse file
tests/baselines/reference/unusedDestructuring.symbols
Copy file name to clipboardExpand all lines: tests/baselines/reference/unusedDestructuring.symbols+13-7Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
27 | 33 | |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
34 | 40 | |
35 | 41 | |
36 | | - |
| 42 | + |
37 | 43 | |
38 | 44 | |
Collapse file
tests/baselines/reference/unusedDestructuring.types
Copy file name to clipboardExpand all lines: tests/baselines/reference/unusedDestructuring.types+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
25 | 25 | |
26 | 26 | |
27 | 27 | |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
28 | 34 | |
29 | 35 | |
30 | 36 | |
|
Collapse file
tests/baselines/reference/unusedLocalsInMethod2.errors.txt
Copy file name to clipboard+4-7Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | | - |
2 | | - |
| 1 | + |
3 | 2 | |
4 | 3 | |
5 | | - |
| 4 | + |
6 | 5 | |
7 | 6 | |
8 | 7 | |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
| 8 | + |
| 9 | + |
13 | 10 | |
14 | 11 | |
15 | 12 | |
0 commit comments