fix: remove javascript grammar - #626
Conversation
nmote
left a comment
There was a problem hiding this comment.
Probably also worth archiving https://github.com/semgrep/semgrep-javascript
| @@ -1 +1 @@ | |||
| ../src/semgrep-javascript No newline at end of file | |||
| ../src/semgrep-typescript/javascript No newline at end of file | |||
There was a problem hiding this comment.
Probably less confusing to just remove this symlink altogether
There was a problem hiding this comment.
The plan was to archive semgrep-javascript, but I seem to have insufficient perms at the moment.
Keeping the symlink seems to be more consistent with other stuff. Thinking particularly of tsx, which we treat as a sublang of typescript already, but that similarly symlinks to semgrep-typescript/tsx. It also seems like the test-lang script depends on the existence of this symlink.
Review: JavaScript-grammar removalChecked whether automated tests still pass, whether the TypeScript grammar is affected, and swept for leftover JavaScript references. Verified all of this by actually running the scripts locally (initialized the ✅ Already fixed by 8693d43 ("fix corpus symlink for javascript")
🔴 Still open — will break CI
There's no 🟡 Minor — stale JavaScript references left behind
TypeScript grammarUnaffected. The |
…e matching line The `pattern: $X.div($Y)` match for `underlyingUnit.mul(balanceWithInvested()).div(totalSupply())` is textually on the line with the `:` (else) branch of the ternary, not the line where the enclosing assignment starts. Confirmed by parsing this snippet directly: the `.div(...)` call_expression's span is entirely on that line. The `// ruleid:` annotation was one line above the wrong branch, which happened to line up with a less precise (pre-tree-sitter-solidity v1.2.13) parse of this multi-line ternary. Move the annotation immediately above the branch actually being matched. Surfaced by semgrep/ocaml-tree-sitter-semgrep#626 (tree-sitter-solidity bump to v1.2.13), which produces the correct AST here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resolves LANG-592.
Semgrep uses the typescript tree-sitter parser for javascript, so the semgrep-javascript grammar is outdated. This PR removes it.
In the future:
Checklist