🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@inversifyjs/eslint-plugin-require-extensions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inversifyjs/eslint-plugin-require-extensions

ESLint plugin to enforce file extensions in ESM imports and exports

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
65
-26.14%
Maintainers
1
Weekly downloads
 
Created
Source

@inversifyjs/eslint-plugin-require-extensions

ESLint plugin to enforce file extensions in ESM imports and exports.

Installation

pnpm add -D @inversifyjs/eslint-plugin-require-extensions

Usage

Add the plugin to your ESLint configuration:

import requireExtensions from '@inversifyjs/eslint-plugin-require-extensions';

export default [
  {
    plugins: {
      'require-extensions': requireExtensions,
    },
    rules: {
      'require-extensions/require-extensions': 'error',
      'require-extensions/require-index': 'error',
    },
  },
];

Rules

require-extensions

Enforces that all relative imports and exports include a file extension.

require-index

Enforces that directory imports and exports include an index file (e.g., ./foo becomes ./foo/index.js). This rule ensures that when importing from a directory, the path explicitly ends with /index.js (or the appropriate extension).

This rule is auto-fixable and accepts no configuration options.

License

MIT

Keywords

eslint

FAQs

Package last updated on 14 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts