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.

npm install eslint-parser-plain
INSTALL
IMPORT
SIG · ESLINT-PARSER-PLAI
E
eslint-parser-plain
testingjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

parserMeta
import { parserMeta } from 'eslint-parser-plain'
Exported since v0.1.1. Use to access parser metadata (e.g., name, version).
default export (parser object)
import parser from 'eslint-parser-plain'
const parser = require('eslint-parser-plain')
The default export is an object with parse and parseForESLint methods. ESM-only; require() will fail in CJS contexts.
parseForESLint
import { parseForESLint } from 'eslint-parser-plain'
const { parseForESLint } = require('eslint-parser-plain')
Named export for the ESLint parser API. Same ESM restriction applies.

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 issues
gotchaeslint-parser-plain does not perform syntax validation; it treats all input as plain text. This may hide syntax errors in files like JSON.
fix
Ensure your files are syntactically valid before linting, or combine with another parser for validation.
affects: >=0.1.0
breakingESM-only package: using require('eslint-parser-plain') will throw 'ERR_REQUIRE_ESM'.
fix
Use import statements or dynamic import() in CJS contexts. Alternatively, configure ESLint to support ESM parsers.
affects: >=0.1.0
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.
fix
Do not rely on the AST structure; this parser is intended only for plain text string extraction.
affects: >=0.1.0
deprecatedNo known deprecations; all current APIs are stable.
fix
N/A
affects: >=0.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-parser-plain/dist/index.js from /path/to/.eslintrc.cjs not supported.
ESLint config file (e.g., .eslintrc.cjs) uses require() for an ESM-only package.
fix
Change .eslintrc.cjs to .eslintrc.mjs and use import statements, or use dynamic import: const parser = await import('eslint-parser-plain');
Parsing error: The parser 'eslint-parser-plain' is not found.
The package is not installed or is not in node_modules.
fix
Run 'npm install eslint-parser-plain --save-dev' and ensure your ESLint configuration points to the correct package name.
TypeError: (0 , _default.parse) is not a function
Importing default export incorrectly in a CommonJS context.
fix
Use the named export parseForESLint or import the default as shown in the quickstart.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-parser-plain — npm install eslint-parser-plain · libregistry