Gremlint is a dedicated linter and code formatter for the Gremlin graph query language, currently at stable version 3.8.1. It follows Apache TinkerPop releases with a cadence tied to TinkerPop (approximately bi-annual major releases). Unlike general SQL formatters, it understands Gremlin's traversal semantics and syntax (including steps, lambdas, and closures), providing automatic formatting, style enforcement, and error detection. It is ESM-only and ships TypeScript type definitions. It requires Node.js 20+ and works in both CLI and programmatic modes.
npm install gremlintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic formatting of a Gremlin query string with indentation and line length options, plus basic error handling and CLI equivalent.
Switch to import or use dynamic import().
Update Node.js to v20 or higher.
Use new option names: indentation (number) and maxLineLength (number).
Check diagnostics.length === 0 for success; array contains { line, column, message, severity } objects.Import specific named exports (formatGremlinQuery, lintGremlinQuery, etc.) instead of default import.
Use: new GremlintError({ message: '...', query: '...' })Replace const x = require('gremlint') with import { x } from 'gremlint'Use import { formatGremlinQuery } from 'gremlint' instead of import gremlint from 'gremlint'Upgrade Node.js to version 20 or later.
Validate the query syntax before calling formatGremlinQuery; catch GremlintError for detailed diagnostics.