{"id":19655,"library":"eslint-import-context","title":"eslint-import-context","description":"A utility library providing context information for eslint-plugin-import-x, eliminating the need for extra arguments. Version 0.2.0 is the current stable release, actively maintained with frequent patches. It ships TypeScript types and relies on oxc-resolver as a peer dependency. Key differentiator: simplifies usage of eslint-plugin-import-x by wrapping resolver context.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/un-ts/eslint-import-context","tags":["javascript","typescript"],"install":[{"cmd":"npm install eslint-import-context","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-import-context","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-import-context","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for resolver context","package":"oxc-resolver","optional":false}],"imports":[{"note":"ESM-only; CommonJS require may work but is not recommended.","wrong":"const { useRuleContext } = require('eslint-import-context')","symbol":"useRuleContext","correct":"import { useRuleContext } from 'eslint-import-context'"},{"note":"Named export, not default.","wrong":"const getTsconfigWithContext = require('eslint-import-context').getTsconfigWithContext","symbol":"getTsconfigWithContext","correct":"import { getTsconfigWithContext } from 'eslint-import-context'"},{"note":"No default export; use named imports instead.","wrong":"import * as eslintImportContext from 'eslint-import-context'","symbol":"default","correct":"import eslintImportContext from 'eslint-import-context'"}],"quickstart":{"code":"import { useRuleContext, getTsconfigWithContext } from 'eslint-import-context';\n\n// In an ESLint rule\nconst rule = {\n  create(context) {\n    const ruleContext = useRuleContext(context);\n    const tsconfig = getTsconfigWithContext(ruleContext);\n    return {};\n  }\n};\n\nexport default rule;","lang":"typescript","description":"Shows how to use useRuleContext and getTsconfigWithContext in an ESLint rule to get resolver context and tsconfig."},"warnings":[{"fix":"npm install oxc-resolver or add to peerDependencies.","message":"v0.2.0 migrated from unrs-resolver to oxc-resolver. Ensure you have oxc-resolver as a peer dependency.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Use stable-hash-x instead.","message":"v0.1.8 replaced stable-hash with stable-hash-x. Update imports if manually using stable-hash.","severity":"deprecated","affected_versions":">=0.1.8"},{"fix":"Install tslib separately if needed.","message":"v0.1.5 removed tslib dependency. If you depend on tslib for other reasons, ensure it's still installed.","severity":"gotcha","affected_versions":">=0.1.5"},{"fix":"Check bundler configuration for CommonJS compatibility.","message":"v0.1.3 changed to CommonJS single entry type. May affect bundlers expecting ESM.","severity":"breaking","affected_versions":">=0.1.3"},{"fix":"Update to >=0.1.4 or manually add missing peer deps.","message":"Version 0.1.4 fixed missing peer dependencies; earlier versions required manual installation.","severity":"gotcha","affected_versions":"<0.1.4"},{"fix":"Update to v0.1.6 or later for correct types.","message":"The package ships TypeScript types but may have incomplete types in early versions (e.g., v0.1.6 fixed NodeResolverOptions).","severity":"gotcha","affected_versions":"<0.1.6"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install oxc-resolver --save-dev","cause":"Missing peer dependency after upgrading to v0.2.0.","error":"Cannot find module 'oxc-resolver'"},{"fix":"import { getTsconfigWithContext } from 'eslint-import-context'","cause":"Incorrect import; likely using default import or wrong named export.","error":"TypeError: getTsconfigWithContext is not a function"},{"fix":"Update to stable-hash-x or downgrade to v0.1.7.","cause":"Using old peer dependency stable-hash with v0.1.8+.","error":"Module not found: Can't resolve 'stable-hash'"},{"fix":"Update eslint-import-context to v0.1.6 or later.","cause":"Using Typescript definitions older than v0.1.6.","error":"Type error: Property 'NodeResolverOptions' does not exist on type..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}