/ls-lint

An extremely fast file and directory name linter

Primary LanguageGoMIT LicenseMIT

logo

ls-lint

An extremely fast file and directory name linter

Build Status Go Report Card Version License

  • 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

command

Example & How-to (vue.js)

  • .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: kebab-case
  .sh: kebab-case
  .dev.js: kebab-case
  .prod.js: kebab-case
  .d.ts: kebab-case
  .vdom.js: kebab-case
  .spec.js: kebab-case

  dist:
    .js: point.case

  benchmarks/ssr:
    .js: camelCase

ignore:
  - test
  - benchmarks/dbmon/ENV.js
  - .babelrc.js
  - .eslintrc.js
  - .github
  - .circleci
  - .git

Install & Run

Binary

MacOS

curl -sL -o ls-lint https://github.com/loeffel-io/ls-lint/releases/download/v1.2.1/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.2.1/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.2.1/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

Benchmarks (hyperfine)

Package Mean [s] File
vuejs/vue 13.9 ms ± 1.2 ms examples/vuejs-vue

Logo

Logo created by Anastasia Marx

License

ls-lint is open-source software licensed under the MIT license.