Skip to content
An extremely fast file and directory name linter - Bring some structure to your file and directory names
Go JavaScript Makefile Dockerfile
Branch: master
Clone or download

Latest commit

Latest commit 8656b46 Mar 21, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docker update docker file Mar 12, 2020
examples clean up vuejs-next config Mar 18, 2020
npm update version Mar 18, 2020
.drone.yml update ls-lint Mar 20, 2020
.gitignore CR remarks Mar 13, 2020
.ls-lint.yml add regex informations Mar 12, 2020
LICENSE Initial commit Feb 16, 2020
Makefile CR remarks Mar 13, 2020
README.md add vant support Mar 21, 2020
config.go
config_test.go fix ignore index Mar 4, 2020
error.go remove unused code Mar 4, 2020
go.mod add glob Mar 18, 2020
go.sum add glob Mar 18, 2020
linter.go add glob Mar 18, 2020
ls-lint.png rename Mar 11, 2020
main.go support or rules, update sync and fix memory issue Mar 17, 2020
rule.go add copy rule Mar 12, 2020
rule_camelcase.go update pascalcase Mar 17, 2020
rule_camelcase_test.go improve camel case test Mar 17, 2020
rule_kebabcase.go improve kebab-case Mar 17, 2020
rule_kebabcase_test.go
rule_lowercase.go init Mar 12, 2020
rule_lowercase_test.go add config test Mar 4, 2020
rule_pascalcase.go update pascalcase command Mar 17, 2020
rule_pascalcase_test.go update pascalcase Mar 17, 2020
rule_pointcase.go update pointcase and snakecase rules Mar 17, 2020
rule_pointcase_test.go update pointcase and snakecase rules Mar 17, 2020
rule_regex.go add regex test Mar 12, 2020
rule_regex_test.go add regex test Mar 12, 2020
rule_snakecase.go update pointcase and snakecase rules Mar 17, 2020
rule_snakecase_test.go update pointcase and snakecase rules Mar 17, 2020
test.go add config test Mar 4, 2020

README.md

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)
  • Incredibly fast
  • Full unicode support
  • Linux, MacOS & Windows Support
  • Docker support & Npm package support
  • Part of Vue.js 3 and Vant
  • Almost zero third-party dependencies (only go-yaml and doublestar)

Demo

command

Example & How-to (vuejs/vue-next)

  • .ls-lint.yml file must be present in your root directory
  • Multiple rules supported by | - They are logicly OR combined
  • .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:
  .js: kebab-case
  .ts: camelCase
  .d.ts: kebab-case
  .mock.ts: kebab-case
  .spec.ts: camelCase
  .test-d.ts: kebab-case
  .config.js: kebab-case
  .umd.js: kebab-case
  .spec.ts.snap: camelCase

  scripts:
    .js: camelCase

  packages/**/{components,collections}:
    .ts: PascalCase
    .spec.ts: PascalCase

ignore:
  - node_modules
  - .git
  - .circleci
  - .github
  - .vscode

Install & Run

Binary

MacOS

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

NPM

Install

# global
npm install -g @ls-lint/ls-lint

# local
npm install @ls-lint/ls-lint

Run

# global
ls-lint

# local
node_modules/.bin/ls-lint # use backslashs for windows

npx @ls-lint/ls-lint

Docker

docker run -t -v /path/to/files:/data lslintorg/ls-lint:1

Rules

Rule Alias Description
regex - Checks if string matches regex pattern: ^{pattern}$
lowercase - Checks if every letter is lower; Skip non letters
camelcase camelCase Checks if string is camel case; Only letters and digits allowed
pascalcase PascalCase Checks if string is pascal case; Only letters and digits allowed
snakecase snake_case Checks if string is snake case; Only lowercase letters, digits and _ allowed
kebabcase kebab-case Checks if string is kebab case; Only lowercase letters, digits and - allowed
pointcase point.case Checks if string is "point case"; Only lowercase letters, digits and . allowed

Roadmap

  • Public and Private Registry to share configurations
  • Npm Windows package (one package for all os)
  • Docker support
  • Regex Rule
  • Windows support
  • Npm package
  • Add ignore directories and files

Major changes

v1.8.0

  • Added glob support like packages/** or packages/*/src

v1.7.0

  • Rules improved: more tests, more flexibility, digits allowed. Checkout rules for more informations

v1.6.0

  • Rules are not longer logicly AND combined - Now they are logicly OR combined by |

v1.5.0

  • Npm packages ls-lint-darwin and ls-lint-linux are not longer supported. Please use @ls-lint/ls-lint instead (linux, windows and macOS support)

Benchmarks (hyperfine)

Package Mean [s] File
vuejs/vue 283.3 ms ± 19.6 ms examples/vuejs-vue
vuejs/vue-next 267.3 ms ± 9.3 ms examples/vuejs-vue-next

Logo

Logo created by Anastasia Marx

License

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

You can’t perform that action at this time.