0.0.20 • Published 12 months ago

eslint-plugin-lucky-fsd v0.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

eslint-plugin-lucky-fsd

Plugin for Feature-Sliced Design(it was developed for Windows and may not work on Mac) 1. Checks that the paths inside the component are relative. Also supports checking with aliases. 2. Prohibits importing from non-public api 3. Prohibits import from overlying layers

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-lucky-fsd:

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

Usage

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

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

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

'lucky-fsd/path-checker' - checks that the paths inside the component are relative. Also supports checking with aliases. 'lucky-fsd/public-api-imports' - prohibits importing from non-public api 'lucky-fsd/layer-imports' - prohibits import from overlying layers

{
    rules: {
      'lucky-fsd/path-checker': ['error', { alias: '@' }],
      'lucky-fsd/public-api-imports': [
        'error',
        {
          alias: '@',
          testFilesPatterns: ['**/*.test.*', '**/*.stories.*', '**/StoreDecorator.tsx'],
        }
      ],
      'lucky-fsd/layer-imports': [
        'error',
        {
          alias: '@',
          ignoreImportPatterns: [ '**/StoreProvider' ],
        }
      ]
    },
}
0.0.20

12 months ago

0.0.16

12 months ago

0.0.17

12 months ago

0.0.18

12 months ago

0.0.19

12 months ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

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.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago