Repository navigation
Commit 1452dc9
authored
feat: Add suggestions to no-console (#17680)
* feat: Add suggestions to no-console
Fixes #17493
* Fix method of when to show safe suggestions and fix tests.
* improved formatting of tests with suggestions by breaking them into multiple lines
* Updated function name to canProvideSuggestions. Added better description for the function.
* Fixed code that fails when AST is not deep enough.
* Added suggestions:null for test cases that will not provide a suggestion.
* test to make sure console statement with semicolon is removed via suggestion
* dont provide suggestions if removing console.log() will lead to ASI breaking
* missing period
* renamed regexps variable names for better understanding
* updated passing in expressionstatement node instead of memberexpression node to maybeAsiHazard
* ++ or -- in the token before is not always safe.1 parent 6fb8805 commit 1452dc9
2 files changed
Lines changed: 451 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
97 | 158 | | |
98 | 159 | | |
99 | 160 | | |
| |||
102 | 163 | | |
103 | 164 | | |
104 | 165 | | |
| 166 | + | |
| 167 | + | |
105 | 168 | | |
106 | 169 | | |
107 | 170 | | |
108 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
109 | 181 | | |
110 | 182 | | |
111 | 183 | | |
| |||
0 commit comments