@toptal/davinci-dir-lint

1.0.0 • Public • Published

@toptal/davinci-dir-lint

Linter for folder structure and naming.

Usage

Use it by installing yarn add @toptal/davinci-syntax in your project.

davinci-syntax lint dir .

Configuration

The package comes with the default configuration:

{
  "namespaces/*/*": "regex:^(apps|libs)$",
  "namespaces": "kebab-case",
  "apps": "kebab-case",
  "libs": "kebab-case",
  "hosts": "kebab-case"
}

Which means:

  • "namespaces/*/*": "regex:^(apps|libs)$"

    Valid:

    namespaces
    |
    └─── billing
         |
         └─── apps
         |
         └─── libs
    

    Invalid:

    namespaces
    |
    └─── billing
         |
         └─── utils
         |
         └─── core
    
  • "namespaces": "kebab-case"

    Valid:

    namespaces
    |
    └───billing-product
    

    Invalid:

    namespaces
    |
    └───billingProduct
    

Right now it's possible to change the default configuration only by contribution to Davinci.

Rules

Regexp

Regexp validation for folder names.

Example:

{
  "namespaces": "regex:^(apps|libs)$"
}

kebab-case

Validates that folder names are in kebab-case.

Example:

{
  "apps": "kebab-case"
}

Package Sidebar

Install

npm i @toptal/davinci-dir-lint

Weekly Downloads

4,051

Version

1.0.0

License

ISC

Unpacked Size

12.4 kB

Total Files

20

Last publish

Collaborators

  • talbot