Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-fsd-architecture

tony-show30ISC0.0.14

ESlint plugin to comply with FSD (Feature Sliced Design) frontend architecture rules

fsd, frontend, feature-sliced-design, architecture, frontend-architecture, fsd-rules, linting, eslint, eslintplugin, eslint-plugin

readme

eslint-plugin-fsd-architecture

ESlint plugin to comply with FSD (Feature Sliced Design) frontend architecture rules. FSD Architecture documentation

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-fsd-architecture:

npm install eslint-plugin-fsd-architecture --save-dev

Usage

Add fsd-architecture to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "fsd-architecture"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "fsd-architecture/rule-name": 2
    }
}

Rules

Name Description
import-path-check Checking imports against FSD architecture rules
layer-imports Rule for check imports from layers structure of FSD architecture
public-api-imports FSD Architecture rule for public api imports

changelog

0.0.13 (2023-05-09)

  • Add auto fix for import-path-check rule error (Within one slice, all import paths must be relative)

0.0.13 (2023-04-29)

  • Fix public-api-imports rule for relative path for import from another layer.
  • Add auto fix for error of this rule (Must be imported from a public API file (index.js/ts)) See rule documentation of last incorrect import path example

0.0.12 (2023-04-29)

  • Add auto fix option for public-api-imports rule If the --fix option on the command line automatically fixes problems of "Absolute import is allowed only from public API (index.js/ts)" reported by the rule.

0.0.11 (2023-04-27)

  • Add git repo url

0.0.10 (2023-04-27)

  • Added changelog

Added documentation

0.0.9 (2023-04-27)

  • Added documentation
  • Change in import-path-check rule. For shared layer imports. See examples in the documentation of rule.