Semgrep CLI vs ESLint
ESLint ranks higher at 61/100 vs Semgrep CLI at 57/100. Capability-level comparison backed by match graph evidence from real search data.
| Feature | Semgrep CLI | ESLint |
|---|---|---|
| Type | CLI Tool | Extension |
| UnfragileRank | 57/100 | 61/100 |
| Adoption | 1 | 1 |
| Quality | 1 | 1 |
| Ecosystem | 0 | 0 |
| Match Graph | 0 | 0 |
| Pricing | Free | Free |
| Capabilities | 14 decomposed | 13 decomposed |
| Times Matched | 0 | 0 |
Semgrep CLI Capabilities
Semgrep-core (OCaml engine) performs AST-based pattern matching against user-defined or curated rules to identify security vulnerabilities, code anti-patterns, and compliance violations. The engine parses source code into language-specific abstract syntax trees using tree-sitter and custom parsers, then matches patterns expressed in Semgrep's domain-specific language (YAML-based rule syntax) against the AST structure. This approach enables structural matching rather than regex-based detection, reducing false positives and enabling cross-language consistency.
Unique: Uses tree-sitter-based AST parsing with language-specific custom parsers for 30+ languages, enabling structural pattern matching that understands code semantics (function scope, variable binding, control flow) rather than relying on regex or token-based matching. The hybrid Python-OCaml architecture delegates computationally intensive matching to OCaml while maintaining a flexible Python CLI for workflow orchestration.
vs alternatives: Faster and more accurate than regex-based tools (Grype, Trivy) because it matches against AST structure; more flexible than signature-based scanners because rules can express complex syntactic patterns; lighter-weight than full symbolic execution tools (Coverity, Fortify) while still catching many real vulnerabilities.
Semgrep's taint analysis engine (available in Pro Engine) tracks data flow across function boundaries to detect vulnerability chains where untrusted input reaches a dangerous sink. The system constructs a dataflow graph by analyzing variable assignments, function parameters, return values, and object field mutations across the codebase. It identifies sources (user input, external data), sinks (SQL queries, command execution, file writes), and sanitizers (validation functions) to determine if tainted data can reach dangerous operations without proper sanitization.
Unique: Implements interprocedural taint analysis by constructing a dataflow graph from AST analysis, tracking variable bindings and function call chains to determine if untrusted data can reach dangerous sinks. The Pro Engine reduces false positives by ~25% and increases true positives by ~250% compared to single-function pattern matching by confirming actual reachability rather than just pattern presence.
vs alternatives: More precise than pattern-only matching (which flags all SQL queries regardless of input source) and faster than full symbolic execution tools because it uses lightweight dataflow analysis rather than constraint solving.
Semgrep includes language-specific parsers (built on tree-sitter and custom OCaml implementations) for 30+ programming languages. Each parser converts source code into an AST that the pattern matching engine can analyze. The system implements graceful error handling where parse errors in individual files do not stop the scan; instead, errors are logged and scanning continues on other files. This enables Semgrep to scan heterogeneous codebases with mixed languages and syntax variations without failing on unparseable code.
Unique: Implements language-specific parsers using tree-sitter (for most languages) and custom OCaml implementations (for performance-critical languages), with graceful error handling that allows scanning to continue even if individual files fail to parse. This architecture enables Semgrep to support 30+ languages without requiring language-specific scanning tools.
vs alternatives: More comprehensive language support than language-specific tools (like Pylint for Python or ESLint for JavaScript) because it handles multiple languages in a single tool; more robust than regex-based tools because it parses code into AST structure.
Semgrep includes an MCP server implementation that exposes scanning capabilities to AI models and LLM-based tools. The MCP server allows AI assistants to invoke Semgrep scans, retrieve findings, and analyze code patterns programmatically. This enables integration with AI-powered code review tools, automated remediation assistants, and LLM-based security analysis workflows. The server implements standard MCP protocols for tool invocation and result streaming.
Unique: Implements an MCP server that exposes Semgrep scanning capabilities to AI models and LLM-based tools, enabling integration with AI-powered code review and remediation workflows. The server implements standard MCP protocols for tool invocation, allowing AI assistants to invoke Semgrep scans and analyze findings programmatically.
vs alternatives: Enables AI-assisted code analysis by exposing Semgrep as an MCP tool; more integrated than separate AI and scanning tools because findings are directly available to AI models for reasoning and remediation.
Semgrep's OCaml engine tracks token positions and source locations during AST parsing and pattern matching, enabling precise reporting of finding locations (file, line, column, character offset). The system maintains a mapping between AST nodes and their source positions, allowing findings to be reported with exact character ranges. This enables IDE integration, inline code comments, and precise highlighting in web interfaces. The position tracking is implemented at the parser level and maintained through the entire analysis pipeline.
Unique: Maintains token and position tracking throughout the OCaml analysis pipeline, enabling precise character-level location reporting for findings. This architecture enables IDE integration, inline code highlighting, and automated remediation by providing exact token ranges rather than just line numbers.
vs alternatives: More precise than tools reporting only line numbers because it provides character offsets; enables better IDE integration and automated fixes because exact token ranges are available.
Semgrep provides a YAML-based domain-specific language (DSL) for expressing code patterns that work across multiple programming languages. Rules are defined in YAML with pattern syntax that abstracts away language-specific details (e.g., a pattern for 'function call' works identically in Python, JavaScript, and Go). The pysemgrep CLI parses rule files, validates syntax, and passes compiled rules to semgrep-core for matching. Users can write custom rules targeting their codebase, organization standards, or specific vulnerability patterns without modifying the core engine.
Unique: Provides a language-agnostic YAML-based DSL that abstracts away language-specific syntax details, allowing a single rule to match equivalent patterns across Python, JavaScript, Go, Java, and 25+ other languages. Rules are compiled to an intermediate representation that semgrep-core interprets, enabling rapid rule iteration without recompiling the core engine.
vs alternatives: More accessible than writing custom checkers in OCaml or C++ (as required by Clang Static Analyzer or Coverity) and more expressive than regex-based tools because rules can reference AST structure and semantic relationships.
The `semgrep ci` command integrates Semgrep into CI/CD workflows by scanning code, uploading findings to semgrep.dev, comparing against baseline scans, and enforcing organization-wide policies. The Python CLI (pysemgrep) orchestrates the workflow: it authenticates to Semgrep App using API tokens, fetches organization-specific rules and policies, runs the OCaml scanning engine, and reports results. The system can block CI builds based on policy rules (e.g., 'fail if critical vulnerabilities detected'), automatically triage findings based on organization rules, and track finding status across commits.
Unique: Implements a hybrid local-remote workflow where the OCaml scanning engine runs locally (fast, no data transmission) but policy enforcement and finding triage happen server-side via semgrep.dev API. This architecture enables organizations to enforce policies without exposing source code to the cloud while maintaining centralized policy management. The system tracks finding status across commits, enabling developers to see remediation progress.
vs alternatives: More flexible than GitHub's native code scanning (which only supports GitHub-native rules) because it supports custom rules and cross-language patterns; more integrated than standalone SAST tools because it provides built-in CI/CD orchestration and finding management.
Semgrep supports incremental scanning mode where it compares current scan results against a baseline (previous commit or main branch) to report only new or changed findings. The Python CLI manages baseline storage and comparison logic: it fetches the previous scan's JSON output, compares rule matches by file path and line number, and reports only findings that are new, moved, or changed in severity. This reduces noise in CI/CD by surfacing only actionable changes rather than all findings in the codebase.
Unique: Implements baseline comparison at the Python CLI layer by storing and comparing JSON scan results, enabling incremental reporting without requiring the OCaml engine to maintain state. This design allows flexible baseline sources (local files, semgrep.dev API, git history) while keeping the core scanning engine stateless.
vs alternatives: Simpler than tools requiring full codebase re-analysis (like some SAST tools) because it compares results rather than re-running analysis; more practical than git-diff-based filtering because it handles line number shifts and can detect moved findings.
+6 more capabilities
ESLint Capabilities
Executes ESLint rules against the active editor file as the user types or on file save, rendering violations as colored squiggles and inline decorations directly in the editor gutter. The extension hooks into VS Code's diagnostic API to push linting results from the ESLint library (installed locally or globally) into the editor's rendering pipeline, enabling immediate visual feedback without requiring manual linting commands.
Unique: Integrates directly with VS Code's native diagnostic API and editor rendering pipeline, allowing ESLint violations to appear as native squiggles and gutter decorations rather than as separate panel output; uses the ESLint library's rule engine directly without wrapping or re-implementing linting logic.
vs alternatives: Tighter VS Code integration than generic linting tools because it leverages VS Code's built-in diagnostic system and respects editor theme colors for error/warning rendering, whereas standalone linters require separate output parsing.
Automatically applies ESLint's `--fix` capability to the active file when saved, modifying the file in-place to correct fixable violations (e.g., formatting, semicolon insertion, import sorting). The extension triggers the ESLint library's fix mode on the save event, applies the corrected code back to the editor buffer, and updates diagnostics to reflect the post-fix state.
Unique: Leverages ESLint's native `--fix` API rather than implementing a separate formatting engine; integrates the fix operation into VS Code's save event lifecycle, allowing fixes to be applied transparently without user interaction or separate command invocation.
vs alternatives: More reliable than Prettier-only solutions because it respects ESLint rule configuration and can fix non-formatting issues (e.g., import sorting, variable naming); more integrated than running ESLint as a separate task because fixes are applied synchronously on save.
Caches linting results for files that have not changed, avoiding redundant ESLint execution and improving performance for large codebases. The extension tracks file modifications and only re-runs ESLint for changed files, reducing computational overhead and latency for real-time linting feedback.
Unique: Implements file-level caching to avoid redundant ESLint execution, tracking file modifications and only re-linting changed files; caching strategy is transparent to users and requires no configuration.
vs alternatives: More performant than re-linting all files on every change because it only processes modified files; more transparent than manual cache management because caching is automatic and invisible to users.
Maps ESLint rule severity levels (error, warning, off) to VS Code diagnostic severity levels (Error, Warning, Information), rendering violations with appropriate colors and icons in the editor. The extension translates ESLint's severity classification into VS Code's diagnostic system, enabling consistent visual representation across the editor and Problems panel.
Unique: Maps ESLint severity levels directly to VS Code's diagnostic API, enabling native severity rendering without custom UI; respects VS Code's theme and editor settings for diagnostic colors and icons.
vs alternatives: More integrated than custom severity rendering because it uses VS Code's native diagnostic system; more consistent than separate severity indicators because it leverages the editor's built-in visual language.
Aggregates all linting violations from the active file and workspace into VS Code's built-in Problems panel, displaying violations with severity levels (error, warning, info) and allowing filtering by severity. The extension pushes diagnostic data into VS Code's diagnostic collection, which automatically populates the Problems panel and respects the `eslint.quiet` setting to suppress info-level messages.
Unique: Uses VS Code's native diagnostic collection API to push ESLint violations into the Problems panel, allowing seamless integration with VS Code's built-in error aggregation and navigation UI rather than implementing a custom panel.
vs alternatives: More discoverable than inline-only linting because violations are visible in a dedicated panel even when the file is not in focus; more integrated than external linting tools because it uses VS Code's native UI rather than requiring a separate output window.
Automatically detects and loads ESLint configuration from either flat config format (`eslint.config.js`, `.mjs`, `.cjs`, `.ts`, `.mts`) or legacy format (`.eslintrc.*` in JSON, JS, YAML) based on what exists in the workspace. The extension respects the `eslint.useFlatConfig` setting to force flat config mode for ESLint 8.57.0+, and falls back to legacy config detection for older versions.
Unique: Implements automatic detection of both flat and legacy config formats without requiring explicit user configuration; uses the `eslint.useFlatConfig` setting to allow users to force flat config mode for ESLint 8.57+, enabling gradual migration from legacy to flat config.
vs alternatives: More flexible than tools that only support one config format because it handles both legacy and flat configs transparently; more user-friendly than requiring manual config path specification because it automatically discovers configs in standard locations.
Allows users to specify which file types should be linted by configuring the `eslint.validate` setting with an array of VS Code language identifiers (e.g., `["javascript", "typescript", "javascriptreact"]`). The extension checks each file's language identifier against the configured list before running ESLint, skipping linting for files not in the list.
Unique: Uses VS Code's language identifier system to filter files before linting, allowing granular control over which file types are processed; integrates with VS Code's language detection rather than implementing custom file type detection.
vs alternatives: More precise than file extension-based filtering because it respects VS Code's language detection (e.g., distinguishing between JavaScript and JSX); more flexible than ESLint's built-in ignore patterns because it operates at the extension level before ESLint is invoked.
Provides a `eslint.quiet` boolean setting that, when enabled, suppresses ESLint info-level diagnostic messages while preserving error and warning messages. The extension filters diagnostics before pushing them to VS Code's diagnostic collection, removing entries with severity below warning level.
Unique: Implements message filtering at the extension level after ESLint execution, allowing users to suppress info-level messages without modifying ESLint configuration or rules; provides a simple boolean toggle rather than complex filtering logic.
vs alternatives: Simpler than configuring ESLint rules to disable info-level messages because it requires only a single setting change; more effective than ESLint's built-in severity configuration because it applies uniformly across all rules.
+5 more capabilities
Verdict
ESLint scores higher at 61/100 vs Semgrep CLI at 57/100.
Need something different?
Search the match graph →