Lint file name formatting.
With npm:
npm i fnlint --save
With yarn:
yarn add fnlint
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.json
- run linter on given options
- callback is called once linting completes
- synchronous version
- promise version
ok
Boolean pass value.true
if all files pass.passing
Array of passing file paths.failing
Array of failing file paths.
fnlint({
basePath: './lib',
files: '**/*.js',
format: 'kebabcase'
}, (err, results) => {
assert.ifError(err);
if (!results.ok) {
process.exit(1);
}
});
basePath
Base path for files to lint.files
Glob string for files to lint relative to base path.format
File name format.reporter
(optional) Set to false to turn off console reporter.directories
(optional) Set to true to lint full path including directories.
kebabcase
(e.g.kebab-case.js
)camelcase
(e.g.camelCase.js
)pascalcase
(e.g.PascalCase.js
)snakecase
(e.g.snake_case.rb
)
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!
Please use the angular changelog convention for your commit messages.
MIT : http://opensource.org/licenses/MIT
- Custom file path parsers
- Custom matchers
- CLI