Commit eb0b353
Fix false positive in async detection for mixed commented/uncommented tags
Critical bug fix: The content_has_only_commented_async? method was
incorrectly flagging files that had:
- Uncommented javascript_pack_tag WITHOUT :async
- Commented javascript_pack_tag WITH :async
The previous implementation checked if ANY uncommented javascript_pack_tag
existed, not specifically ones with :async. This caused false positives.
Solution: Refactored to remove all commented lines first, then check if
:async exists in the remaining content. This handles both single-line
and multi-line tags correctly and is more robust.
Added comprehensive test case to prevent regression.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent cda9a31 commit eb0b353
File tree
2 files changed
+26
-17
lines changed- lib/react_on_rails
- spec/lib/react_on_rails
2 files changed
+26
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
1229 | | - | |
1230 | 1229 | | |
1231 | 1230 | | |
1232 | 1231 | | |
1233 | 1232 | | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1249 | 1239 | | |
1250 | 1240 | | |
1251 | | - | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
1252 | 1244 | | |
1253 | 1245 | | |
1254 | 1246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
345 | 362 | | |
346 | 363 | | |
347 | 364 | | |
| |||
0 commit comments