Skip to content

Daniel-Griffiths/structure-lint

Repository files navigation

Structure Lint 📁

A linter to check the directory/file structure of your projects.

Tests

Install globally

npm install -g structure-lint
# Or Yarn
yarn global add structure-lint

Install as a package

npm install structure-lint
# Or Yarn
yarn add structure-lint

Then add the following command to your package.json file:

{
  "scripts": {
    "structure-lint": "structure-lint"
  }
}

Usage

Create a .structurelintrc file in the root of your project. See the example config file below:

{
  "root": "src",
  "rules": [
    "utils/*.ts",
    "hooks/*.ts",
    "interfaces/I*.ts",
    "components/**/*.tsx",
    "deeply/**/nested/**/folder/*.{tsx,ts,js}"
  ]
}