eslint-plugin-fsd-import
v0.0.13
Published
Plugin for checking imports path in FSD project
Downloads
3,579
Maintainers
Readme
eslint-plugin-fsd-import
Plugin for checking imports path in FSD project.
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-fsd-import
:
npm install eslint-plugin-fsd-import --save-dev
Usage
Add fsd-import
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"fsd-import"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"fsd-import/fsd-relative-path": "error",
"fsd-import/public-api-imports": "error",
"fsd-import/layer-imports": "error",
}
}
Supported Rules
Check FSD imports is correct:
- fsd-relative-path Imports within one slice should be relative.
- public-api-imports Absolute imports should be only from public API.
- layer-imports Modules on one layer can only interact with modules from the layers strictly below.