{"id":42214,"library":"vfile-to-eslint","title":"vfile-to-eslint","description":"Converts VFile instances into ESLint-compatible LintResult arrays, enabling use of ESLint formatters with non-ESLint linting tools like remark. v4.0.0 is the current stable release; maintained by the unified collective, with TypeScript types included. ESM-only since v1, no CJS support. Differentiates by bridging vfile ecosystem to ESLint output format.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/vfile/vfile-to-eslint","tags":["javascript","vfile","vfile-util","vfile-reporter","util","utility","virtual","file","reporter","typescript"],"install":[{"cmd":"npm install vfile-to-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add vfile-to-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add vfile-to-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for VFile type; required for input and output types.","package":"vfile","optional":false},{"reason":"Commonly used together for linting pipelines, though not a direct dependency.","package":"unified","optional":true}],"imports":[{"note":"Only named export; no default export, so default import results in undefined.","wrong":"import toESLint from 'vfile-to-eslint'","symbol":"toESLint","correct":"import { toESLint } from 'vfile-to-eslint'"},{"note":"TypeScript only; type import is necessary to avoid runtime error.","wrong":"import { LintResult } from 'vfile-to-eslint' (at runtime)","symbol":"LintResult","correct":"import type { LintResult } from 'vfile-to-eslint'"},{"note":"vfile-to-eslint is ESM-only; require() throws ERR_REQUIRE_ESM.","wrong":"const { toESLint } = require('vfile-to-eslint')","symbol":"require (CommonJS)","correct":"const { toESLint } = await import('vfile-to-eslint')"}],"quickstart":{"code":"import { remark } from 'remark';\nimport gfm from 'remark-gfm';\nimport frontmatter from 'remark-frontmatter';\nimport lint from 'remark-lint';\nimport eslintFormatterPretty from 'eslint-formatter-pretty';\nimport { toESLint } from 'vfile-to-eslint';\n\nconst file = await remark()\n  .use(frontmatter)\n  .use(gfm)\n  .use(lint)\n  .process('## Hello world!');\n\nconsole.log(eslintFormatterPretty(toESLint([file])));","lang":"typescript","description":"Processes a markdown file with remark-lint and outputs results using an ESLint formatter via toESLint."},"warnings":[{"fix":"Wrap the file in an array: toESLint([file])","message":"toESLint expects an array of VFile objects; passing a single VFile will cause errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check the VFile for any additional metadata not captured by the LintResult type and handle separately.","message":"The output LintResult may not fully map all VFile properties to ESLint format; non-standard properties are lost.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to version 16 or higher.","message":"vfile-to-eslint v4 drops support for Node.js 14, requires Node 16+.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use named import: import { toESLint } from 'vfile-to-eslint'","message":"No default export; only named export toESLint. Using default import results in undefined.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'array':13 'bridg':52 'cjs':48 'collect':37 'compat':11 'convert':5 'current':30 'differenti':50 'ecosystem':54 'enabl':14 'eslint':4,10,17,22,56 'eslint-compat':9 'esm':43 'esm-on':42 'file':70 'format':58 'formatt':18 'includ':41 'instanc':7 'javascript':59 'like':25 'lint':23 'lintresult':12 'maintain':33 'non':21 'non-eslint':20 'output':57 'releas':32 'remark':26 'report':66,71 'sinc':45 'stabl':31 'support':49 'tool':24 'type':40 'typescript':39,72 'unifi':36 'use':15 'util':63,67,68 'v1':46 'v4.0.0':27 'vfile':2,6,53,60,62,65 'vfile-report':64 'vfile-to-eslint':1 'vfile-util':61 'virtual':69","created_at":"2026-06-04T18:56:10.636414+00:00","updated_at":"2026-06-04T18:56:10.636414+00:00","problems":[{"fix":"Run 'npm install vfile-to-eslint' or ensure tsconfig.json includes node module resolution.","cause":"Missing dependency or incorrect import path in TypeScript project.","error":"Cannot find module 'vfile-to-eslint' or its corresponding type declarations"},{"fix":"Use dynamic import: const { toESLint } = await import('vfile-to-eslint') or convert to ESM.","cause":"Using require() to import an ESM-only package in a CommonJS context.","error":"ERR_REQUIRE_ESM"},{"fix":"Wrap the file in an array: toESLint([file])","cause":"Passed a single VFile instead of an array of VFiles to toESLint.","error":"TypeError: files is not iterable"},{"fix":"Use named import: import { toESLint } from 'vfile-to-eslint'","cause":"Trying to import a default export which does not exist.","error":"'default' is not exported by vfile-to-eslint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/vfile/vfile-to-eslint#readme","github":"https://github.com/vfile/vfile-to-eslint","docs":null,"changelog":null,"pypi":null,"npm":"vfile-to-eslint","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}