0.1.8 • Published 1 year ago

eslint-plugin-fsd-projects v0.1.8

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

eslint-plugin-fsd-projects

Use power ESLint for Feature-Sliced Design architectural methodology for frontend projects

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-fsd-projects:

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

Usage

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

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

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

{
    rules: {
      "fsd-projects/path-checker": ["error", { param: "" }]
    }
}

Supported Rules

FSD / path-checker

Feature-Sliced Design architectural methodology for relative path checker, using an alias. Specify the alias you are using. The key accepts any string value. Rule supports autofix.

{
    rules: {
      "fsd-projects/path-checker": ["error", { alias: "@" }]
    }
}

FSD / public-api-imports

Import control from external modules only through public api. Rule supports autofix.

testFilesPatterns

The key takes an array of strings as its value. Allows you to specify aliases for test environments excluded from the rule

{
    rules: {
        'fsd-projects/public-api-imports': [
            'error',
            {
                alias: '@',
                testFilesPatterns: ['**/*.test.*', '**/*.story.*', '**/StoreDecorator.tsx'],
            },
        ]
    }
}

FSD / layer-imports

Prohibition of the use of overlying layers in the underlying

testFilesPatterns

The key takes an array of strings as its value. Allows you to specify aliases for test environments excluded from the rule

{
    rules: {
        'fsd-projects/layer-imports': [
            'error',
            {
                alias: '@',
                ignoreImportPatterns: ['**/StoreProvider', '**/testing'],
            },
        ],
    }
}
0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago