toml-eslint-parser is a specialized parser designed to convert TOML (Tom's Obvious, Minimal Language) formatted text into an Abstract Syntax Tree (AST) that is fully compatible with ESLint. This enables developers to lint TOML files within the ESLint ecosystem, applying stylistic and structural checks similar to how JavaScript files are processed. The package is currently at version 1.0.3 and maintains an active development status, featuring regular patch releases for fixes and documentation updates, and minor releases for new features like enhanced TOML specification support. Major versions, such as the recent v1.0.0, introduce breaking changes, notably the transition to an ESM-only package. A key differentiator is its robust support for the stable TOML 1.0.0 specification, alongside experimental support for the unreleased TOML 1.1.0, offering early adoption for upcoming TOML features. While it can be integrated directly into an ESLint configuration, it is often recommended to use it in conjunction with `eslint-plugin-toml`, which conveniently bundles this parser and provides a comprehensive set of TOML-specific linting rules.
npm install toml-eslint-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates configuring `toml-eslint-parser` in an `eslint.config.js` file for parsing TOML files, specifying TOML 1.1.0.
Update your import statements from `require()` to `import` syntax. Ensure your project's `package.json` specifies `"type": "module"` or files use the `.mjs` extension for ES Modules in Node.js.
Upgrade your Node.js runtime to a compatible version.
For maximum stability, stick to `tomlVersion: "1.0.0"`. If using `1.1.0`, be prepared for potential adjustments in future minor updates of the parser.
To lock parsing behavior to a specific TOML standard, explicitly set `parserOptions.tomlVersion` to a version string like `"1.0.0"` or `"1.1.0"` instead of `"latest"`.
Change CommonJS `require` statements to ES Module `import` statements. For Node.js, ensure your `package.json` includes `"type": "module"` or use `.mjs` file extensions.
Update your Node.js environment to a version compatible with the package's `engines` field (e.g., Node.js 20.19.0+, 22.13.0+, or 24+).
Review the `parserOptions.tomlVersion` setting in your ESLint configuration and ensure it's one of the supported values: `"1.0.0"`, `"1.1.0"`, `"1.0"`, `"1.1"`, `"latest"`, or `"next"`.
No dependency data recorded yet.