{"id":18960,"library":"any-eslint-parser","title":"any-eslint-parser","description":"Check any file type with ESLint using a parser that ignores AST-based rules, allowing text-based rules like eol-last and no-tabs to be applied to non-JavaScript files (e.g. JSON, YAML, Markdown, XML, etc.). Current stable version is 1.0.1. The package has no release cadence documented and is a niche tool for leveraging ESLint's text-based rules across diverse file formats. Differentiators include zero AST dependency for linting, compatibility with eslint-plugin-regex, and ability to use existing ESLint configuration infrastructure.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/gmullerb/any-eslint-parser","tags":["javascript","any-eslint-parser","eslint-plugin-regex","eslint","parser","style","regex","regexp","lint"],"install":[{"cmd":"npm install any-eslint-parser","lang":"bash","label":"npm"},{"cmd":"yarn add any-eslint-parser","lang":"bash","label":"yarn"},{"cmd":"pnpm add any-eslint-parser","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; necessary to run eslint with the parser.","package":"eslint","optional":false}],"imports":[{"note":"Parser is used in ESLint configuration, not imported directly in code.","wrong":"Using \"parser\": \"any-eslint-parser\" in a JavaScript file (it's a config option, not an import)","symbol":"any-eslint-parser","correct":"In .eslintrc: { \"parser\": \"any-eslint-parser\" }"},{"note":"Since v1.0.0, using --no-eslintrc is recommended to avoid AST-based rules from other configs.","wrong":"eslint \"**/*.json\" (without specifying the parser config)","symbol":"eslint","correct":"npx eslint --config .eslintrc-any.json --no-eslintrc \"**/*.json\""},{"note":"Package exports no JavaScript API; it's only a parser for ESLint config.","wrong":"import anyEslintParser from 'any-eslint-parser'","symbol":"defaultParser","correct":"Not applicable; there is no exported symbol."}],"quickstart":{"code":"// 1. Install dependencies\n// npm install --save-dev any-eslint-parser eslint\n\n// 2. Create .eslintrc-any.json with parser and text-based rules\n// { \"parser\": \"any-eslint-parser\", \"rules\": { \"eol-last\": \"error\", \"no-tabs\": \"error\" } }\n\n// 3. Run eslint with the custom config\n// npx eslint --config .eslintrc-any.json --no-eslintrc \"**/*.+(json|yml|xml|md|txt|sh)\"\n\n// Example output for a JSON file with tabs:\n// 1:1  error  Unexpected tab character  no-tabs\n// 2:1  error  Newline required at end of file but not found  eol-last","lang":"javascript","description":"Sets up ESLint with any-eslint-parser to lint JSON, YAML, XML, Markdown, and other text files for trailing newlines and tabs."},"warnings":[{"fix":"Use only text-based rules (e.g. eol-last, no-tabs, eslint-plugin-regex rules) in the parser's config.","message":"AST-based rules like no-unused-vars are ignored silently; no error is thrown but they produce no effect.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pass --no-eslintrc to eslint to ignore all other config files, or use a dedicated eslintrc file for any-eslint-parser.","message":"Using any-eslint-parser without --no-eslintrc may cause unexpected behavior if parent configs contain AST rules.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"","message":"No deprecation warnings in package.","severity":"deprecated","affected_versions":""},{"fix":"","message":"No breaking changes documented; version 1.0.1 is the only release.","severity":"breaking","affected_versions":""}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Set parser to 'any-eslint-parser' in the ESLint config for the file patterns.","cause":"Parser tries to parse non-JavaScript file as JavaScript because default parser is espree.","error":"Parsing error: The keyword 'import' is reserved"},{"fix":"Run 'npm install --save-dev any-eslint-parser' to install the parser.","cause":"any-eslint-parser is not installed; missing npm package.","error":"Error: Failed to load parser 'any-eslint-parser'"},{"fix":"Specify the config file with '--config /path/to/.eslintrc-any.json'.","cause":"Using --no-eslintrc without providing a config file via --config.","error":"No ESLint configuration found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}