eslint-plugin-fsd-core
Version:
ESLint rules to enforce clean layer structure and import conventions in Feature-Sliced Design projects.
58 lines (40 loc) ⢠2 kB
Markdown
# šÆ Eslint plugin based on FSD
An ESLint plugin designed to enforce path conventions based on the Feature-Sliced Design (FSD) methodology.
## š¦ Installation
First, ensure you have [ESLint](https://eslint.org/) installed:
```sh
npm i eslint --save-dev
```
Then, install the `eslint-plugin-fsd-core` package:
```sh
npm install eslint-plugin-fsd-core --save-dev
```
## āļø Configuration
Add `fsd-core` to the `plugins` section of your `.eslintrc` file:
```json
{
"plugins": ["fsd-core"]
}
```
Then, enable the desired rules in the `rules` section:
```json
{
"rules": {
"fsd-core/path-checker": "error"
}
}
```
## š Documentation of available Rules
<!-- begin auto-generated rules list -->
š§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).
| Name | Description | š§ |
| :----------------------------------------------------------- | :------------------------- | :- |
| [layer-imports-checker](docs/rules/layer-imports-checker.md) | FSD layers imports checker | |
| [path-checker](docs/rules/path-checker.md) | FSD relative path checker | š§ |
| [public-api-checker](docs/rules/public-api-checker.md) | FSD public api checker | š§ |
<!-- end auto-generated rules list -->
| Rule Name | Description |
| ------------------------------------------------------------ | ---------------------------------------------- |
| [layer-imports-checker](docs/rules/layer-imports-checker.md) | Ensures correct layer imports in FSD structure |
| [path-checker](docs/rules/path-checker.md) | Validates relative paths within FSD components |
| [public-api-imports](docs/rules/public-api-checker.md) | Restricts direct imports outside public API |