eslint-plugin-arch-imports

0.0.3 • Public • Published

eslint-plugin-arch-imports

Restrict files that can be imported.

installation

npm i -D eslint-plugin-arch-imports

Usage

plugin

{
  "plugins": {
    "arch-imports"
  }
}

rules

Sample

  • src/components can import 'src/components' and 'src/hooks'
  • src/hooks can import 'src/hooks'
{
  "rules": {
      "arch-imports/arch-imports": [
      "error",
      {
          ruleList: [
              {
                  filePath: /src\/components\/.+/,
                  allowPathList: [
                      /src\/components\/.+/,
                      /src\/hooks\/.+/
                  ]
              },
              {
                  filePath: /src\/hooks\/.+/,
                  allowPathList: [
                      /src\/hooks\/.+/
                  ]
              }
          ],
          fileExtList: ["", "ts", "tsx"]
      }
  ]
  }
}

Readme

Keywords

Package Sidebar

Install

npm i eslint-plugin-arch-imports

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

10.1 kB

Total Files

9

Last publish

Collaborators

  • openriceworks