0.0.22 • Published 2 years ago

eslint-plugin-trn-plugin v0.0.22

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

eslint-plugin-trn-plugin

The plugin contains the following rules:

1) path-checker - prohibits absolute imports within one module 2) layer-imports - checks if layers are used correctly from Feature-Sliced Design point of view (e.g. widgets cannot be used in features and entities) 3) public-api-imports - allows import from other modules only from public api. Has auto fix

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-trn-plugin:

npm install eslint-plugin-trn-plugin --save-dev

Usage

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

{
    "plugins": [
        "trn-plugin"
    ]
}

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

{
    "rules": {
      "trn-plugin/path-checker": [
        "error",
        {
          alias: "@",
        },
      ],
      
      "trn-plugin/layer-imports": [
        "error",
        {
          alias: "@", ignoreImportPatterns: ["**/StoreProvider", "**/testing"],
        },
      ],
      
      "trn-plugin/public-api-imports": [
        "error",
        {
          alias: "@",
          testFilesPatterns: ["**/*.test.*", "**/*.story.*", "**/StoreDecorator.tsx"],
        },
      ],
      
    }
}
0.0.22

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.16

2 years ago

0.0.8

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago