eslint-plugin-fsd-rules-checker-latest
v0.1.8
Published
eslint-plugin-fsd-rules-checker
Maintainers
Readme
eslint-plugin-fsd-rules-checker
eslint-plugin-fsd-rules-checker
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-fsd-rules-checker:
npm install eslint-plugin-fsd-rules-checker --save-devUsage
Add fsd-rules-checker to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"fsd-rules-checker"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"fsd-rules-checker/rule-name": 2
}
}Support for path aliases was added in version 0.0.4
{
"rules": {
"fsd-rules-checker/rule-name": [
"error",
{
"alias": "yourAlias"
}
]
}
}Rules
- path-checker - Within a single "slice", all paths must be relative paths
- public-api-imports - Absolute imports, only from public api (index.js) | Test data should be imported from public api publicApi/testing.ts
- layer-imports - A layer can only import underlying layers into itself (shared, entities, features, widgets, pages, app)
