eslint-plugin-import-esm

2.0.0 • Public • Published

eslint-plugin-import-esm

ESLint plugin that enforces imports to follow native ESM resolution.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-import-esm:

npm install eslint-plugin-import-esm --save-dev

This plugin works well with eslint-plugin-import, which validates existence of paths amongst other checks.

Usage

Using the recommended preset:

{
  "extends": ["plugin:import-esm/recommended"]
}

Using without the recommended preset:

{
  "plugins": ["import-esm"],
  "rules": {
    "import-esm/explicit-extension": ["error", { "extension": ".ms" }]
  }
}

Rules

💼 Configurations enabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.

Name               Description 💼 🔧
explicit-extension Validate if import and export paths have an explicit extension 🔧

/eslint-plugin-import-esm/

    Package Sidebar

    Install

    npm i eslint-plugin-import-esm

    Weekly Downloads

    2,213

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    13 kB

    Total Files

    9

    Last publish

    Collaborators

    • satazor