Socket
Book a DemoInstallSign in
Socket

eslint-plugin-no-omit-index

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-omit-index

Disallow omitting "index" in import paths

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

eslint-plugin-no-omit-index

Rules

  • no-omit-index
    Enforce explicitly mentioning the index within the directory and prohibits directly specifying a directory in import statements.
// OK
import { foo } from './directory/index';
import { foo } from './directory/index.js';

// Error
import { foo } from './directory';

Installation

# inside your project's working tree
npm i -D eslint-plugin-no-omit-index

In .eslintrc.json:

{
  "plugins": ["eslint-plugin-no-omit-index"],
  "rules": {
    "eslint-plugin-no-omit-index/no-omit-index": "error"
  }
}

Keywords

eslint

FAQs

Package last updated on 02 Jan 2024

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