Describe the bug
Only ts is working for typescript. Neither tsx nor typescript are recognized, as they are supposed to be.
$ semgrep -f mysemgrep
error: invalid language
14 | message: "onDestroy not implemented"
15 | languages: [typescript]
| ^^^^^^^^^^^^
16 | severity: ERROR
unsupported language typescript
Reason--there is a missing comma:
https://github.com/returntocorp/semgrep/blob/d3fe469c7edc44f179cf7754836ed5f34d073614/semgrep/semgrep/target_manager.py#L61
Change this:
elif language in {"ts", "tsx" "typescript"}:
To this:
elif language in {"ts", "tsx", "typescript"}:
Ahah, semgrep can find this bug now!
@mschwager @minusworld a new python rule to put in semgrep-rules/ ?
{..., "..." "....", ...} is probably a bug with a missing comma typo.
I'll add it in the local semgrep.yml
Should work now.
Most helpful comment
Ahah, semgrep can find this bug now!
semgrep/semgrep/target_manager.py:61
elif language in {"ts", "tsx" "typescript"}:
semgrep/semgrep/target_manager.py:61
elif language in {"ts", "tsx" "typescript"}: