Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qdanik/eslint-plugin-path
An ESLint plugin for enforcing consistent imports across project.
https://github.com/qdanik/eslint-plugin-path
eslint eslint-plugin import javascript lint linting relative-path
Last synced: about 2 months ago
JSON representation
An ESLint plugin for enforcing consistent imports across project.
- Host: GitHub
- URL: https://github.com/qdanik/eslint-plugin-path
- Owner: qdanik
- License: mit
- Created: 2022-03-28T20:48:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-23T12:42:21.000Z (7 months ago)
- Last Synced: 2024-12-08T04:05:54.602Z (about 2 months ago)
- Topics: eslint, eslint-plugin, import, javascript, lint, linting, relative-path
- Language: JavaScript
- Homepage:
- Size: 295 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-path [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/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
```sh
# npm
npm install eslint-plugin-path --save-dev# yarn
yarn add eslint-plugin-path --dev
```## Configuration
Enable the rules in your ESLint configuration file:
```json
{
"plugins": ["path"],
"rules": {
"path/no-relative-imports": "error",
}
}
```Or add the "recommended" preset:
```json
{
"extends": ["plugin:path/recommended"]
}
```## Rules
✔ included in the "recommended" preset
🔧 fixable using the `--fix` command line option
| | | Name | Description |
| --- | --- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| ✔ | 🔧 | [no-relative-imports](https://github.com/qDanik/eslint-plugin-path/blob/main/docs/rules/no-relative-imports.md) | disallow relative imports of files where absolute is preferred |## Presets
- `recommended` enables rules recommended for all users
- `all` enables all rules# License
[MIT](https://github.com/qDanik/eslint-plugin-path/blob/main/LICENSE)