hhast
hhast copied to clipboard
Add 'lint errors with context and full details' output mode
For example, something along the lines of input file:
function foo(): void {
for($i = 0; $i < 10; $i++) {
await bar();
}
}
HHAST could optionally output something like...
function foo(): void {
for($i = 0; $i < 10; $i++) {
> await bar();
| ^^^^^^^^^^^
| DontAwaitInALoop Linter:
| blah blah blah more details here
}
}
Even if not directly useful, it would be good to use this for the unit test non-autofix .expect
files - they would be much easier to review for correctness and completeness
actually, we basically have this, it's the default mode.
What's needed is to add /all/ the information that's in the JSON output to it to allow replacing the expect files
also the AwaitInLoop linter intentionally overrides the default output to print out specific lines but doesn't point to the exact relevant node at each line