Registry / testing / eslint-plugin-index

eslint-plugin-index

JSON →
library1.1.7jsnpmunverified

An ESLint plugin (v1.1.7) providing rules to enforce proper usage of index.js files in Node.js projects. Includes two rules: `only-import-export` (allows only import/export statements in index files) and `forbid` (disallows files named index). Supports ESLint 7 or 8. Recommended for projects wanting to enforce index file conventions. Niche, simple, minimal overhead. Not updated frequently.

testing
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESLint automatically strips 'eslint-plugin-' prefix when loading plugins from node_modules.

// in .eslintrc: { "plugins": ["index"] }

Extending plugin configs requires 'plugin:' prefix.

// in .eslintrc: { "extends": ["plugin:index/recommended"] }

Rule name must include plugin namespace prefix 'index/'.

// in .eslintrc rules: { "index/only-import-export": "error" }

Rule name must include plugin namespace prefix 'index/'.

// in .eslintrc rules: { "index/forbid": "error" }

Install the plugin, enable recommended rules, and optionally enable the forbid rule.

npm install -D eslint eslint-plugin-index // .eslintrc.json { "plugins": ["index"], "extends": ["plugin:index/recommended"], "rules": { "index/forbid": "error" } }
Debug
Known footguns
gotchaPlugin is designed to lint index.js files; does not work on other file names.
gotchaRules only apply to .js files; does not handle .ts or .jsx by default.
gotchaThe 'forbid' rule forbids any file named index; may conflict with legitimate index files.
gotchaThe 'only-import-export' rule allows only import and export statements; other statements cause errors.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources