{"id":14138,"library":"toml-eslint-parser","title":"ESLint TOML Parser","description":"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.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/toml-eslint-parser","tags":["javascript","toml","eslint","parser","ast"],"install":[{"cmd":"npm install toml-eslint-parser","lang":"bash","label":"npm"},{"cmd":"yarn add toml-eslint-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add toml-eslint-parser","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Since v1.0.0, the package is ESM-only and must be imported using ES Modules syntax.","wrong":"const tomlParser = require('toml-eslint-parser');","symbol":"tomlParser","correct":"import * as tomlParser from 'toml-eslint-parser';"},{"note":"Imports for types are typically used in TypeScript environments to specify parser options.","symbol":"TOMLVersionOption","correct":"import type { TOMLVersionOption } from 'toml-eslint-parser';"},{"note":"While `* as` is common for parsers, a direct default import may also be possible depending on module resolution and how the main export is configured in `package.json`.","symbol":"parser as default export","correct":"import tomlParser from 'toml-eslint-parser';"}],"quickstart":{"code":"import * as tomlParser from 'toml-eslint-parser';\n\nexport default [\n  {\n    files: [\"**/*.toml\"],\n    languageOptions: {\n      parser: tomlParser,\n      parserOptions: {\n        tomlVersion: \"1.1.0\" // Explicitly set TOML version\n      }\n    }\n  }\n];","lang":"javascript","description":"Demonstrates configuring `toml-eslint-parser` in an `eslint.config.js` file for parsing TOML files, specifying TOML 1.1.0."},"warnings":[{"fix":"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.","message":"Version 1.0.0 transitioned to an ESM-only package, removing CommonJS support. This requires environments that support ES Modules.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade your Node.js runtime to a compatible version.","message":"The package now requires Node.js versions `^20.19.0 || ^22.13.0 || >=24`.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"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.","message":"Support for TOML 1.1.0 is currently experimental, as the specification is still under development. Breaking changes related to TOML 1.1.0 parsing may occur in minor releases of this parser.","severity":"gotcha","affected_versions":">=0.11.0"},{"fix":"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\"`.","message":"The `parserOptions.tomlVersion: \"latest\"` alias points to the most recent TOML specification supported (currently 1.1.0). This alias may shift to a newer TOML version in future minor releases of `toml-eslint-parser`, potentially introducing subtle changes in parsing behavior.","severity":"gotcha","affected_versions":">=0.11.0"}],"env_vars":null,"search_vec":"'1.0.0':121 '1.0.3':64 '1.1.0':130 'abstract':25 'activ':68 'adopt':133 'alongsid':123 'appli':46 'ast':28,182 'break':99 'bundl':164 'chang':100 'check':50 'compat':32 'comprehens':170 'configur':147 'conjunct':156 'conveni':163 'convert':14 'current':61 'design':12 'develop':37,69 'differenti':112 'direct':143 'document':78 'earli':132 'ecosystem':45 'enabl':36 'enhanc':87 'eslint':1,6,34,44,146,159,180 'eslint-plugin-toml':158 'esm':107 'esm-on':106 'experiment':124 'featur':71,85,137 'file':41,55 'fix':76 'format':21 'fulli':31 'integr':142 'introduc':98 'javascript':54,178 'key':111 'languag':20 'like':86 'lint':39,176 'maintain':66 'major':91 'minim':19 'minor':81 'new':84 'notabl':101 'obvious':18 'offer':131 'often':150 'packag':59,109 'parser':3,7,11,166,181 'patch':73 'plugin':160 'process':57 'provid':168 'recent':96 'recommend':151 'regular':72 'releas':74,82 'robust':115 'rule':177 'set':171 'similar':51 'special':10 'specif':89,122,175 'stabl':119 'status':70 'structur':49 'stylist':47 'support':90,116,125 'syntax':26 'text':22 'tom':16 'toml':2,5,15,40,88,120,129,136,161,174,179 'toml-eslint-pars':4 'toml-specif':173 'transit':103 'tree':27 'unreleas':128 'upcom':135 'updat':79 'use':153 'v1.0.0':97 'version':63,92 'within':42","created_at":"2026-04-20T01:58:08.027438+00:00","updated_at":"2026-04-20T01:58:08.027438+00:00","problems":[{"fix":"Change CommonJS `require` statements to ES Module `import` statements. For Node.js, ensure your `package.json` includes `\"type\": \"module\"` or use `.mjs` file extensions.","cause":"Attempting to `require()` the package after version 1.0.0, which is ESM-only.","error":"ERR_REQUIRE_ESM"},{"fix":"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+).","cause":"Running the package with an unsupported Node.js version.","error":"Error: The engine \"node\" is incompatible with this module. Expected version \"^20.19.0 || ^22.13.0 || >=24\". Got \"v18.x.x\""},{"fix":"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\"`.","cause":"Specifying an unsupported or invalid `tomlVersion` in `parserOptions`.","error":"Parsing error: Unknown TOML version '2.0.0'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ota-meshi/toml-eslint-parser","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/toml-eslint-parser","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}