{"id":19962,"library":"eslint-plugin-toml","title":"eslint-plugin-toml","description":"ESLint plugin for linting TOML files, providing syntax validation, formatting rules (e.g., inline-table-curly-newline, inline-table-curly-spacing), and support for Vue SFC custom blocks. Current stable version is 1.3.1, released monthly with active maintenance. Requires ESLint >=9.38.0 and Node >=20.19.0. Key differentiators: full TOML parsing, ESLint directive support (# eslint-disable-next-line), and integration with editor tools. Alternatives like prettier-plugin-toml focus on formatting only.","status":"active","version":"1.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/eslint-plugin-toml","tags":["javascript","eslint","eslintplugin","eslint-plugin","toml","lint","formatter"],"install":[{"cmd":"npm install eslint-plugin-toml","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-toml","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-toml","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, plugin cannot be used without ESLint","package":"eslint","optional":false}],"imports":[{"note":"Default import provides the plugin object; peer dep ESLint >=9.38.0 requires flat config (ESM).","wrong":"const eslintPluginToml = require('eslint-plugin-toml')","symbol":"eslintPluginToml","correct":"import eslintPluginToml from 'eslint-plugin-toml'"},{"note":"Prefer using .configs.recommended or .configs.standard; flat config only.","wrong":"require('eslint-plugin-toml').configs.recommended","symbol":"configs","correct":"import eslintPluginToml from 'eslint-plugin-toml'; ...eslintPluginToml.configs.recommended"},{"note":"Accidentally treating rules toml/indent as a plain string; correct: access via plugin object after import.","symbol":"rules","correct":"import eslintPluginToml from 'eslint-plugin-toml'; eslintPluginToml.rules['toml/indent']"},{"note":"No named export; only default export.","wrong":"import { parseError } from 'eslint-plugin-toml'","symbol":"parseError"}],"quickstart":{"code":"// eslint.config.js\nimport eslintPluginToml from 'eslint-plugin-toml';\n\nexport default [\n  // add more generic rule sets here, such as:\n  // js.configs.recommended,\n  ...eslintPluginToml.configs.recommended,\n  {\n    rules: {\n      // override/add rules settings here, such as:\n      // 'toml/rule-name': 'error'\n    }\n  }\n];","lang":"javascript","description":"Shows minimal flat config to enable TOML linting via plugin; uses recommended config."},"warnings":[{"fix":"Upgrade ESLint to >=9.38.0 and use flat config (eslint.config.js) instead of .eslintrc.","message":"ESLint <9.38.0 is not supported; plugin requires flat config and language: 'toml/toml' which only works with ESLint >=9.38.0.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Replace ...eslintPluginToml.configs['flat/recommended'] with ...eslintPluginToml.configs.recommended.","message":"The 'flat/' namespace configs (e.g., 'flat/recommended') are deprecated; use unprefixed configs directly.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Install vue-eslint-parser@>=7.3.0 if using Vue SFC with TOML custom blocks.","message":"Vue SCF custom block support requires vue-eslint-parser v7.3.0+, but parser not listed as peer dep.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Review rule options after updates; check CHANGELOG for property changes.","message":"Some rules (e.g., inline-table-curly-spacing) have options like emptyObjects that may change behavior in minor versions.","severity":"gotcha","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import/require the main plugin object only, not internal files.","cause":"Accessing file directly (e.g., require('eslint-plugin-toml/package.json')) which may not be exported.","error":"Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by \"exports\" in ..."},{"fix":"Run 'npm install --save-dev eslint-plugin-toml' and ensure it's in node_modules.","cause":"Missing dependency or incorrect install.","error":"Failed to load plugin 'toml': Cannot find module 'eslint-plugin-toml'"},{"fix":"Set severity as string: 'off', 'warn', 'error', then options: { indent: 2 }.","cause":"Rule expects options object, not array or wrong severity.","error":"Configuration for rule 'toml/indent' is invalid: Value [\"error\", 2] is not a valid rule configuration."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}