README
English | 中文简体
fslint
This is a tool for detecting file system naming styles. It is hard to imagine that there are several different styles of file naming in the same application.
Usage
$ fslint --config=.fslintrc.json
.fslintrc.json is a JSON file look like this:
{
"exclude": ["vendor", "node_modules", "bin", ".git"],
"include": [
{
"file": "./src/**/*.vue", // lint for file
"level": "error",
"pattern": "PascalCase",
"ignore": ["**/index.vue"] // ignore index.vue in this rule
},
{
"folder": "./src/**/*", // lint for folder
"level": "error",
"pattern": "kebab-case"
}
]
}
| Pattern | Description | Recommend |
|---|---|---|
| PascalCase | Pascal Case style | Yes |
| camelCase | Camel Case style | Yes |
| kebab-case | Lowercase letters and concatenated by symbols - |
Yes |
| snake_case | Lowercase letters snake case style and concatenated by symbols _ |
Yes |
| /<regexp>/ | regular expression start with / and end with / |
Installation
If you have installed nodejs, you can install it via npm
npm install @axetroy/fslint -g
If you are using Linux/macOS. you can install it with the following command:
# install latest version
curl -fsSL -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/axetroy/fslint/master/install.sh | bash
# or install specified version
curl -fsSL -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/axetroy/fslint/master/install.sh | bash -s v0.3.2
# or install from gobinaries.com
curl -sf https://gobinaries.com/axetroy/fslint@v0.3.2 | sh
Or Download the executable file for your platform at release page
Test
$ make test
License
The Anti-996 License