@kvadrofilii/eslint-plugin-fsd
v3.1.0
Published
FSD eslint rules
Downloads
4
Maintainers
Readme
@kvadrofilii/eslint-plugin-fsd
ESLint rules for Feature-Sliced Design.
Installation
You'll first need to install ESLint:
npm install eslint --save-dev
Next, install @kvadrofilii/eslint-plugin-fsd
:
npm install @kvadrofilii/eslint-plugin-fsd --save-dev
Usage
Add @kvadrofilii/eslint-plugin-fsd
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["@kvadrofilii/fsd"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@kvadrofilii/fsd/path-checker": "error",
"@kvadrofilii/fsd/public-api-imports": "error",
"@kvadrofilii/fsd/layer-imports": "error"
}
}
Use alias paths.
{
"rules": {
"@kvadrofilii/fsd/path-checker": ["error", { "alias": "@" }],
"@kvadrofilii/fsd/public-api-imports": ["error", { "alias": "@" }],
"@kvadrofilii/fsd/layer-imports": ["error", { "alias": "@" }]
}
}
Use test files pattern for path-checker.
{
"rules": {
"@kvadrofilii/fsd/path-checker": ["error", { "testFilesPatterns": ["**/*.test.*", "**/*.stories.*"] }]
}
}
Use ignore import pattern for layer-imports.
{
"rules": {
"@kvadrofilii/fsd/layer-imports": ["error", { "ignoreImportPatterns": ["**/StoreProvider"] }]
}
}
Rules
| Name | Description | | :----------------------------------------- | :------------------------ | | path-checker | FSD relative path checker |