{"id":25209,"library":"embed-eslint","title":"embed-eslint","description":"ESLint integration for embedded TypeScript compilation. Version 3.1.0 provides a runtime ESLint compiler that extends embed-typescript, allowing linting during TypeScript compilation within Node.js or browser applications. Released as part of the embed-typescript monorepo with periodic updates. Key differentiator: unified diagnostics where ESLint violations are reported as TypeScript diagnostics, with full support for type-aware @typescript-eslint rules. Requires peer dependencies: embed-typescript, typescript, eslint, @typescript-eslint/parser, and @typescript-eslint/eslint-plugin.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/samchon/embed-typescript","tags":["javascript","typescript","compiler","embed","nodejs","browser"],"install":[{"cmd":"npm install embed-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add embed-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add embed-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core embedding TypeScript compiler; embed-eslint extends it","package":"embed-typescript","optional":false},{"reason":"Peer dependency for ESLint core functionality","package":"eslint","optional":false},{"reason":"Peer dependency for parsing TypeScript code","package":"@typescript-eslint/parser","optional":false},{"reason":"Peer dependency for TypeScript-specific lint rules","package":"@typescript-eslint/eslint-plugin","optional":false},{"reason":"Peer dependency for TypeScript compilation","package":"typescript","optional":false}],"imports":[{"note":"Package is ESM-only; default export not available, use named import.","wrong":"const EmbedEsLint = require('embed-eslint')","symbol":"EmbedEsLint","correct":"import { EmbedEsLint } from 'embed-eslint'"},{"note":"TypeScript type should be imported with 'type' modifier to avoid runtime import.","wrong":"import { IEmbedEsLintProps } from 'embed-eslint'","symbol":"IEmbedEsLintProps","correct":"import type { IEmbedEsLintProps } from 'embed-eslint'"},{"note":"EmbedTypeScript is the base class exported from embed-typescript, not from embed-eslint.","wrong":"import { EmbedTypeScript } from 'embed-eslint'","symbol":"EmbedTypeScript","correct":"import { EmbedTypeScript } from 'embed-typescript'"}],"quickstart":{"code":"import { EmbedEsLint } from 'embed-eslint';\nimport ts from 'typescript';\n\nconst compiler = new EmbedEsLint({\n  compilerOptions: {\n    target: ts.ScriptTarget.ES2015,\n    module: ts.ModuleKind.CommonJS,\n    strict: true,\n  },\n  rules: {\n    '@typescript-eslint/no-floating-promises': 'error',\n    '@typescript-eslint/no-unused-vars': 'warn',\n    '@typescript-eslint/explicit-function-return-type': 'error',\n    'no-console': 'warn',\n    'no-debugger': 'error',\n  },\n});\n\nconst result = compiler.compile({\n  'src/index.ts': `\n    async function fetchData() {\n      console.log('Fetching data...');\n      return { data: 'test' };\n    }\n    fetchData();\n    const unused = 42;\n  `,\n});\n\nif (!result.success) {\n  for (const diagnostic of result.diagnostics) {\n    console.log(\n      diagnostic.severity + ': ' + diagnostic.message +\n      ' at ' + diagnostic.file + ':' + diagnostic.start?.line + ':' + diagnostic.start?.column\n    );\n  }\n}","lang":"typescript","description":"Creates an EmbedEsLint compiler with custom rules, compiles a TypeScript file, and outputs ESLint diagnostics."},"warnings":[{"fix":"Install embed-eslint and change imports from 'embed-typescript' to 'embed-eslint' for ESLint functionality.","message":"Starting from v2.0.0, embed-eslint was extracted into its own package from embed-typescript. If you were using embed-typescript's built-in ESLint support before v2, you must now install and import from embed-eslint separately.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade to v2.0.1 or higher.","message":"The IEmbedTypeScriptDiagnostic.file property was incorrectly typed in v2.0.0; fixed in v2.0.1. Users relying on the broken property may have incorrect file references.","severity":"deprecated","affected_versions":"=2.0.0"},{"fix":"Run: npm install embed-typescript typescript eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin","message":"All peer dependencies (embed-typescript, typescript, eslint, @typescript-eslint/parser, @typescript-eslint/eslint-plugin) must be installed separately. Missing one will cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your compilerOptions include 'strict: true' or set 'noEmit: false' to enable type-aware lint rules.","message":"ESLint rules that require type information (e.g., @typescript-eslint/no-floating-promises) only work if the compiler options include type checking (e.g., 'noEmit: false' or 'declaration: true').","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the package: npm install embed-eslint","cause":"The package is not installed or is not in the project's node_modules.","error":"Cannot find module 'embed-eslint' or its corresponding type declarations."},{"fix":"Use correct named import: import { EmbedEsLint } from 'embed-eslint'","cause":"Importing from wrong path or using wrong import style (e.g., default import instead of named).","error":"Module 'embed-eslint' has no exported member 'EmbedEsLint'."},{"fix":"Install the missing dependency: npm install @typescript-eslint/parser","cause":"Missing peer dependency @typescript-eslint/parser.","error":"Error: ESLint configuration is invalid: Cannot find module '@typescript-eslint/parser'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}