Skip to content

Files

Latest commit

 

History

History
83 lines (61 loc) · 1.5 KB

no-unknown-files.md

File metadata and controls

83 lines (61 loc) · 1.5 KB

boundaries/no-unknown-files

Prevent creating files not recognized as any of the element types

Rule details

It checks local files paths. If the file is not recognized as part of any element defined in settings, it will be notified as an error.

Options

"boundaries/no-unknown-files": [<enabled>]
  • enabled: for enabling the rule. 0=off, 1=warn, 2=error.
Options example
{
  "rules": {
    "boundaries/no-unknown-files": [2]
  }
}

Settings

Examples in the next sections are based on the previous options example and these files and settings.

src/
├── helpers/
│   ├── data/
│   │   ├── sort.js
│   │   └── parse.js
│   └── permissions/
│       └── roles.js
│
├── foo.js
└── index.js
{
  "settings": {
    "boundaries/ignore": ["src/index.js"],
    "boundaries/elements": [
      {
        "type": "helpers",
        "pattern": "helpers/*/*.js",
        "mode": "file"
      }
    ]
  }
}

Examples of incorrect files for this rule:

foo.js file is not recognized, so it is not allowed

// src/foo.js

Examples of correct files for this rule:

Helper files are allowed

// src/helpers/data/sort.js

index.js file is not recognized, but it is ignored in settings

// src/index.js

Further reading