0.1.0 ⢠Published 2 years ago
eslint-plugin-fsd-arch-checker v0.1.0
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-devNext, install eslint-plugin-fsd-arch-checker:
npm install eslint-plugin-fsd-arch-checker --save-devUsage
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 |