mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
17 lines (16 loc) • 435 B
YAML
rules:
- id: calling-set-state-on-current-state
patterns:
- pattern: $Y($X);
- pattern-inside: |
const [$X, $Y] = useState(...);
...
message: >-
Calling setState on the current state is always a no-op. Did you mean to change the state like $Y(!$X) instead?
languages:
- javascript
severity: ERROR
metadata:
technology:
- react
category: correctness