UNPKG

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
# šŸŽÆ 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 |