Registry /
testing / eslint-plugin-import-access
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.
importAccess (flat config plugin)
✓ import importAccess from 'eslint-plugin-import-access/flat-config'
✗ import importAccess from 'eslint-plugin-import-access'
v3.x requires importing from the /flat-config subpath for flat config. Direct import is only for eslintrc.
Plugin for eslintrc
✓ plugins: ['import-access']
✗ plugins: ['eslint-plugin-import-access']
In eslintrc, the plugin name is 'import-access' (without prefix). The prefix is automatically resolved.
Rule: import-access/jsdoc
✓ "import-access/jsdoc": ["error"]
✗ "import-access/jsdoc": "error"
The rule requires an array with severity and options. String form is invalid.
Full setup of eslint-plugin-import-access with flat config, plus a code example showing valid and invalid package-private imports.
// Install
npm i -D eslint-plugin-import-access @typescript-eslint/parser @typescript-eslint/eslint-plugin
// eslint.config.js (flat config)
import tsParser from '@typescript-eslint/parser';
import importAccess from 'eslint-plugin-import-access/flat-config';
export default [
{
languageOptions: {
parser: tsParser,
parserOptions: {
project: true,
sourceType: 'module',
},
},
},
{
plugins: {
'import-access': importAccess,
},
},
{
rules: {
'import-access/jsdoc': ['error'],
},
},
];
// sub/foo.ts
/** @package */
export const secret = 'private';
// sub/bar.ts (valid)
import { secret } from './foo';
// baz.ts (invalid)
import { secret } from './sub/foo'; // error
Errors
Common errors & fixes
Error: Failed to load plugin 'import-access' declared in '...': Cannot find module 'eslint-plugin-import-access'
The plugin is not installed or not properly resolved in the ESLint configuration.
fixRun 'npm i -D eslint-plugin-import-access' and ensure it is listed in your dependencies.
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/...` using `parserOptions.project` but was not found.
Missing or incorrect TypeScript project configuration for @typescript-eslint/parser.
fixEnsure parserOptions.project is set to true or a valid tsconfig.json path, and that the file is included in the project.
Definition for rule 'import-access/jsdoc' was not found.
The plugin is not registered in ESLint's plugins section, or the rule name is misspelled.
fixAdd the plugin to the 'plugins' array in flat config or eslintrc, and use the correct rule name 'import-access/jsdoc'.
The 'import-access/jsdoc' rule requires typed linting.
The rule needs TypeScript type information, but the parser is not set up to provide it.
fixEnable 'parserOptions.project: true' and ensure the file is included in your tsconfig.
Audit
Dependencies
@typescript-eslint/parserrequiredRequired for type-aware linting; the plugin relies on TypeScript type information to detect @package annotations.
@typescript-eslint/eslint-pluginoptionalOften used alongside for TypeScript ESLint rules, though not a direct dependency.