ls-lint
An extremely fast file and directory name linter
- Works for directory and file names (all extensions supported)
- Linux, MacOS & Windows Support
- Incredibly fast
- Full unicode support
- Almost zero third-party dependencies (only go-yaml)
Demo
vue.js)
Example & How-to (.ls-lint.yml
file must be present in your root directory- Multiple rules supported by
,
.dir
set rules for the current directory and their subdirectories- Rules for subdirectories will overwrite the rules for all their subdirectories
- For Windows you must use backslashs
\
instead of slashs/
# .ls-lint.yml
ls:
.dir: kebab-case
.js: kebab-case
.css: kebab-case
.html: kebab-case
.json: kebab-case
.ts: point.case
.sh: kebab-case
dist:
.dir: kebab-case
.js: point.case
packages/vue-server-renderer:
.dir: kebab-case
.js: point.case
.json: kebab-case
types/test:
.dir: kebab-case
.js: kebab-case
.json: kebab-case
ignore:
- .babelrc.js
- .eslintrc.js
- .github
- .circleci
- .git
- benchmarks
- test
Install & Run
Binary
MacOS
curl -sL -o ls-lint https://github.com/loeffel-io/ls-lint/releases/download/v1.1.0/ls-lint-darwin && chmod +x ls-lint && ./ls-lint
Linux
curl -sL -o ls-lint https://github.com/loeffel-io/ls-lint/releases/download/v1.1.0/ls-lint-linux && chmod +x ls-lint && ./ls-lint
Windows
# (!) First download the .exe from https://github.com/loeffel-io/ls-lint/releases/download/v1.1.0/ls-lint-windows.exe
ls-lint-windows.exe
NPM
Install
# global
npm install -g ls-lint-linux # for Linux
npm install -g ls-lint-darwin # for macOS
# local
npm install ls-lint-linux # for Linux
npm install ls-lint-darwin # for macOS
Run
# global
ls-lint
# local
node_modules/.bin/ls-lint
npx ls-lint
Rules
Rule | Alias | Description |
---|---|---|
lowercase | - | Checks if every letter is lower; Skip non letters |
camelcase | camelCase | Checks if string is camel case; Only letters allowed |
pascalcase | PascalCase | Checks if string is pascal case; Only letters allowed |
snakecase | snake_case | Checks if string is snake case; Only letters and _ allowed |
kebabcase | kebab-case | Checks if string is kebab case; Only letters and - allowed |
pointcase | point.case | Checks if string is "point case"; Only letters and . allowed |
Roadmap
- Npm Windows package
- Color highlighting
- Regex Rule
- Docker support
- Windows support
- Npm package
- Add ignore directories and files
License
ls-lint is open-source software licensed under the MIT license.