1.0.0 • Published 3 days ago

@toptal/davinci-dir-lint v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 days ago

@toptal/davinci-dir-lint

Linter for folder structure and naming.

Usage

Use it by installing yarn add @toptal/davinci 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"
}
1.0.0

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago