eslint-plugin-feature-sliced-project
v0.0.6
Published
Checking the Feature-Sliced Design (FSD) architecture rules
Downloads
50
Maintainers
Readme
eslint-plugin-feature-sliced-project
Checking the application for compliance with the rules of Feature-Sliced Design (FSD) architecture
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-feature-sliced-project
:
npm install eslint-plugin-feature-sliced-project --save-dev
Usage
Add feature-sliced-project
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["feature-sliced-project"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"feature-sliced-project/relative-import-check": "error",
"feature-sliced-project/import-only-underlying": "error",
"feature-sliced-project/public-api-import": "error"
}
}
Configurations
| | Name |
| :- | :------------ |
| ✅ | recommended
|
Rules
🔧 Automatically fixable by the --fix
CLI option.
| Name | Description | 🔧 | | :------------------------------------------------------------- | :------------------------------------------- | :- | | import-only-underlying | A layer can only import underlying layers | 🔧 | | public-api-import | Public api import rules | 🔧 | | relative-import-check | Within one slice, all paths must be relative | 🔧 |