Registry / testing / eslint-parser-plain

eslint-parser-plain

JSON →
library0.1.1jsnpmunverified

ESLint parser that allows linting of various plain text file types (e.g., Markdown, JSON, YAML) by treating them as plain text strings. Version 0.1.1 is the current stable release with a slow release cadence. It is designed for use with ESLint's parser option to enable linting rules (like prettier/prettier) in non-JavaScript files. Differentiates from @eslint/markdown by being simpler and file-type agnostic.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Exported since v0.1.1. Use to access parser metadata (e.g., name, version).

import { parserMeta } from 'eslint-parser-plain'

The default export is an object with parse and parseForESLint methods. ESM-only; require() will fail in CJS contexts.

import parser from 'eslint-parser-plain'

Named export for the ESLint parser API. Same ESM restriction applies.

import { parseForESLint } from 'eslint-parser-plain'

Configures ESLint to use eslint-parser-plain for .md and .json files, enabling prettier rules on them.

// .eslintrc.cjs module.exports = { overrides: [ { files: ['*.md', '*.json'], parser: 'eslint-parser-plain', rules: { 'prettier/prettier': ['error', { parser: 'markdown' }], }, }, ], };
Debug
Known footguns
gotchaeslint-parser-plain does not perform syntax validation; it treats all input as plain text. This may hide syntax errors in files like JSON.
breakingESM-only package: using require('eslint-parser-plain') will throw 'ERR_REQUIRE_ESM'.
gotchaThe package's parse method returns an object with an 'ast' property set to a minimal token (e.g., { type: 'Program', body: [] }), not a full AST. This may break tools expecting a standard ESTree AST.
deprecatedNo known deprecations; all current APIs are stable.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources