eslint-plugin-path

An ESLint plugin for enforcing consistent imports across project. In other words, it helps to replace all relatives import with absolutes dependinng on settings.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-plugin-path
311.1.33 months agoa year agoMinified + gzip package size for eslint-plugin-path in KB

Readme

eslint-plugin-path code style: prettier
An ESLint plugin for enforcing consistent imports across project. In other words, it helps to replace all relatives import with absolutes dependinng on settings.

Installation

# npm
npm install eslint-plugin-path --save-dev

# yarn
yarn add eslint-plugin-path --dev

Configuration

Enable the rules in your ESLint configuration file:
{
  "plugins": ["path"],
  "rules": {
    "path/no-relative-imports": "error",
  }
}

Or add the "recommended" preset:
{
  "extends": ["plugin:path/recommended"]
}

Rules

āœ” included in the "recommended" preset
šŸ”§ fixable using the --fix command line option
| | | Name | Description | | --- | --- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | āœ” | šŸ”§ | no-relative-imports | disallow relative imports of files where absolute is preferred |

Presets

  • recommended enables rules recommended for all users
  • all enables all rules
License
MIT