eslint-plugin-fsd-arch-checker
v0.1.0
Published
eslint-plugin-fsd-arch-checker
Downloads
6
Maintainers
Readme
eslint-plugin-fsd-arch-checker
This plugin intends to control imports according to FSD architecture
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-fsd-arch-checker
:
npm install eslint-plugin-fsd-arch-checker --save-dev
Usage
Add fsd-arch-checker
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"fsd-arch-checker"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"fsd-arch-checker/relative-imports": "error"
}
}
Options
If you use aliases in your project you can provide this alias into your eslint configuration file
module.exports = {
// ...
'fsd-arch-checker/dependencies-imports': [
'error',
{
alias: '$',
},
],
}
Rules
🔧 Automatically fixable by the --fix
CLI option.
| Name | Description | 🔧 | | :--------------------------------------------------------- | :-------------------------------------- | :- | | relative-imports | forbid absolute imports inside slice | 🔧 | | dependencies-imports | forbid any imports from parent layers | | | public-api-imports | forbid any imports not from public API | |