Skip to content

🚨 Make the case correct, PLEASE!

License

Notifications You must be signed in to change notification settings

JunyWuuuu91/case-police

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚨 CasePolice

NPM version

  • GitHub, not Github
  • TypeScript, not Typescript
  • macOS, not MacOS
  • VS Code, not Vscode
  • ...

Make the case correct, PLEASE!

Usage

Make sure you have committed all unsaved works, and then

npx case-police --fix

It will scan all your source files and fix the cases of known names.

Only the word including both uppercase and lowercase will be fixed. (e.g. Github -> GitHub; github and GITHUB will be left untouched).

Use in CI

Simply add case-police (without --fix) to your workflow and it will exit with a non-zero code for your CI to catch it.

Specific files

By default it will scan all the text files under the current directory (respects .gitignore), if you want it to check only specific files, you can pass the file paths of glob patterns to it.

npx case-police "**/*.md" path/to/file.html

CLI Options

Options Description
[...globs] Files or glob to be checked, if not provided, all the text files will be check
--fix Rewrite changes to file
-d, --dict <path> Custom dictionary JSON, will be merged with original dict
--no-default Disable the default dictionary
--disable <rules> Disable rules, comma separated
--ignore <globs> Files or globs to be ignore, comma separated

Sponsors

License

MIT License © 2021 Anthony Fu

About

🚨 Make the case correct, PLEASE!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.6%
  • JavaScript 1.4%