An extremely fast directory and filename linter
open sourceMITself-hostablefree
ls-lint checks that file and directory names follow your conventions, from rules in one or more .ls-lint.yml files: per directory glob and per extension, names must be kebab-case, camelCase, PascalCase, snake_case, match a regular expression, or exist a given number of times. It handles any extension and full Unicode, lints thousands of files in milliseconds, and has almost no dependencies. It runs on Linux, macOS and Windows and installs from npm, Homebrew, Docker or a GitHub Action.
Ways to install
Package managers
Problems it solves
- enforce kebab-case file names across the repo
- someone keeps adding files named MyComponent.JS next to my-component.ts
- lint file and directory naming conventions in CI
- make sure every component folder has a test file
- require snake_case for Ruby files and PascalCase for React components in one repo
- fail the build when a file name doesn't match a pattern
- a fast check of naming rules for a monorepo with thousands of files
- case-only renames break the build on Linux but not on my Mac
Features
- rules per directory glob and extension
- kebab-case, camelCase, PascalCase, snake_case, screaming snake case
- regex rules
- exists rules (required or forbidden files)
- several .ls-lint.yml files
- Unicode support
- npm package, Homebrew, Docker and GitHub Action
Capabilities
| Has a command line tool | plan not known |
|---|