1.5.1 • Published 7 years ago
fnlint v1.5.1
fnlint
Lint file name formatting.
Installation
With npm:
npm i fnlint --saveWith yarn:
yarn add fnlintUsage
Command Line
Create a config file (an object exporting .js file or .json) with your fnlint configuration. See Options below. Then call fnlint referencing the config file:
fnlint --config fnlint.jsonModule
fnlint(options: {}, callback: Function(error: Error, results: {})) => Void
- run linter on given options
- callback is called once linting completes
fnlint.sync(options: {}) => results: {}
- synchronous version
fnlint.promise(options: {}) => Promise(results: {})
- promise version
Results
okBoolean pass value.trueif all files pass.passingArray of passing file paths.failingArray of failing file paths.
Example
fnlint({
basePath: './lib',
files: '**/*.js',
format: 'kebabcase'
}, (err, results) => {
assert.ifError(err);
if (!results.ok) {
process.exit(1);
}
});Options
basePathBase path for files to lint.filesGlob string for files to lint relative to base path.formatFile name format.reporter(optional) Set to false to turn off console reporter.directories(optional) Set to true to lint full path including directories.
Available Formats
kebabcase(e.g.kebab-case.js)camelcase(e.g.camelCase.js)pascalcase(e.g.PascalCase.js)snakecase(e.g.snake_case.rb)
Contributing
Don't be shy! Submit issues (or better yet PRs) if you see anything that could be better. If you're submitting code that contains patches or features please try to include unit tests. Thanks!
Commit Messages
Please use the angular changelog convention for your commit messages.
License
MIT : http://opensource.org/licenses/MIT
TODO
- Custom file path parsers
- Custom matchers
- CLI