0.0.13 • Published 8 months ago

eslint-plugin-import-checker-plugin v0.0.13

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Import checker plugin

Plugin checks absolute and relative paths in the project

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-import-checker-plugin:

npm install eslint-plugin-import-checker-plugin --save-dev

Usage

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

{
    "plugins": [
        "import-checker-plugin"
    ]
}

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

{
    "rules": {
        "import-checker-plugin/rule-name": ["error", { "alias": "@" }],
        "import-checker-plugin/public-api-imports": [
          "error", 
          {
            "alias": "@",
            "testFilesPatterns": [",**/*.test.ts", ",**/*.story.*", ",**/StoreDecorator.tsx"]
          }
        ],
        "import-checker-plugin/layer-imports": [
          "error",
          {
            "alias": "@",
            "ignoreImportPatterns": ["**/StoreProvider"]
          }
        ]
    }
}

Rules

NameDescription
path-checkerWithin a single slice, all paths must be relative
public-api-importsAbsolute import is only allowed from Public API (index.ts)
layer-importsA layer can only import underlying layers into itself
0.0.10

8 months ago

0.0.11

8 months ago

0.0.12

8 months ago

0.0.13

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.5

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago