3 ms·
It seems from reading the docs that the “semantic” side is important here. It can track things like redefinitions. E.g. const output = console.log; output(“hel
by RichieAHB 5y ago
It seems from reading the docs that the “semantic” side is important here. It can track things like redefinitions.
E.g.
const output = console.log;
output(“hello”);
This wouldn’t be caught by ESLint (to my knowledge) but would be caught by Semgrep. I think you could do it with ESLint but given the interface for an ESLint plugin exposes an AST, you’d have to track this yourself. I’m assuming Semgrep could stretch to things like enforcing APIs are called with certain optional arguments present (even if the TS types don’t require it). Again, I think with ESLint you’d have to do more juggling with the raw AST.
That said, this is my understanding from a quick skim!