Plugin for checking not correctly declared paths for imports using Feature Sliced Design methodology (FSD)
Read more about FSD
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-paths-observer
:
npm install eslint-plugin-paths-observer --save-dev
Add paths-observer
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"paths-observer"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"paths-observer/only-relative-imports-in-layer": [
"error",
{
"alias": "@"
}
],
"paths-observer/only-public-api-imports": [
"error",
{
"alias": "@",
"ignoreFilePatterns": []
}
],
"paths-observer/layer-imports-order": [
"error",
{
"alias": "@",
"ignoreImportPatterns": []
}
]
}
}
- Fill in provided rules here