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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
any-eslint-parser
✓ In .eslintrc: { "parser": "any-eslint-parser" }
✗ Using "parser": "any-eslint-parser" in a JavaScript file (it's a config option, not an import)
Parser is used in ESLint configuration, not imported directly in code.
eslint
✓ npx eslint --config .eslintrc-any.json --no-eslintrc "**/*.json"
✗ eslint "**/*.json" (without specifying the parser config)
Since v1.0.0, using --no-eslintrc is recommended to avoid AST-based rules from other configs.
defaultParser
✓ Not applicable; there is no exported symbol.
✗ import anyEslintParser from 'any-eslint-parser'
Package exports no JavaScript API; it's only a parser for ESLint config.
Sets up ESLint with any-eslint-parser to lint JSON, YAML, XML, Markdown, and other text files for trailing newlines and tabs.
// 1. Install dependencies
// npm install --save-dev any-eslint-parser eslint
// 2. Create .eslintrc-any.json with parser and text-based rules
// { "parser": "any-eslint-parser", "rules": { "eol-last": "error", "no-tabs": "error" } }
// 3. Run eslint with the custom config
// npx eslint --config .eslintrc-any.json --no-eslintrc "**/*.+(json|yml|xml|md|txt|sh)"
// Example output for a JSON file with tabs:
// 1:1 error Unexpected tab character no-tabs
// 2:1 error Newline required at end of file but not found eol-last
Debug
Known issues
gotchaAST-based rules like no-unused-vars are ignored silently; no error is thrown but they produce no effect.fixUse only text-based rules (e.g. eol-last, no-tabs, eslint-plugin-regex rules) in the parser's config.
affects: >=1.0.0
gotchaUsing any-eslint-parser without --no-eslintrc may cause unexpected behavior if parent configs contain AST rules.fixPass --no-eslintrc to eslint to ignore all other config files, or use a dedicated eslintrc file for any-eslint-parser.
affects: >=1.0.0
deprecatedNo deprecation warnings in package.
breakingNo breaking changes documented; version 1.0.1 is the only release.
Errors
Common errors & fixes
Parsing error: The keyword 'import' is reserved
Parser tries to parse non-JavaScript file as JavaScript because default parser is espree.
fixSet parser to 'any-eslint-parser' in the ESLint config for the file patterns.
Error: Failed to load parser 'any-eslint-parser'
any-eslint-parser is not installed; missing npm package.
fixRun 'npm install --save-dev any-eslint-parser' to install the parser.
No ESLint configuration found
Using --no-eslintrc without providing a config file via --config.
fixSpecify the config file with '--config /path/to/.eslintrc-any.json'.
Audit
Dependencies
eslintrequiredPeer dependency; necessary to run eslint with the parser.