Home

Awesome

<p align="center"> <a href="https://github.com/tal-rofe/inflint"> <img src="https://img.shields.io/github/actions/workflow/status/tal-rofe/inflint/integrate.yaml?label=CI&logo=GitHub" alt="CI status"> </a> <a href="https://www.npmjs.com/package/@exlint.io/inflint"> <img src="https://img.shields.io/npm/dm/@exlint.io/inflint?logo=NPM" alt="npm downloads"> </a> <a href="https://github.com/tal-rofe/inflint"> <img src="https://img.shields.io/npm/l/@exlint.io/inflint" alt="npm license"> </a> <a href="https://github.com/tal-rofe/inflint"> <img src="https://img.shields.io/npm/v/@exlint.io/inflint?label=version" alt="version"> </a> </p> <p>&nbsp;</p> <p align="center"><img src="./assets/logo.png" width="60%"/></p> <h2 align="center">Inflint</h2>

Inflint is a tool which scans and verifies files and folders name conventions.

Inflint allows you to easily set file names convention in your repository.

Demo

Inflint

Installation

Globally

npm install --global @exlint.io/inflint

Locally

npm install --save-dev @exlint.io/inflint

Usage

$ inflint [options] [files]

ESM support

Inflint now supports only ESM modules, from version >1.2.10. For any issue regarding this, please visit this link https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Configuration

You can specify the configuration of Inflint through various options. Configuration can be set in the following files:

Rules format

When applying rules either via the CLI or other configuration, you must follow the rules format. "1" and "warn" are warnings rules, "2" and "error" are errors rules. Each rule has key and value. The key represents the glob pattern. When a file matches the pattern, it will be enforced by the rule. The rule value represents the rule enforcement.

Rules enforcement format:

If you provide unknown convention which isn't known one or a configured alias, Inflint considers the "convention" as regex.

Rule option

You can set options for any rule, in order to get some customization.

File names conventions

You can set file names conventions rules using known ones. Inflint allows you to set the following:

ConventionAliasDescription
lowercaselowercaseEvery letter must be lowercase. Ignores non-letters
camelcasecamelCaseMust be in "camelCase" format. Only letters and digits are allowed
camelcase-pointcamelCase.pointMust be in "camelCase" format. Only letters, digits and . are allowed
pascalcasePascalCaseMust be in "PascalCase" format. Only letters and digits are allowed
pascalcase-pointPascalCase.PointMust be in "PascalCase" format. Only letters, digits and . are allowed
snakecasesnake_caseMust be in "snake_case" format. Only lowercase letters, digits and _ are allowed
snakecase-pointsnake_case.pointMust be in "snake_case" format. Only lowercase letters, digits, _ and . are allowed
screamingsnakecaseSCREAMING_SNAKE_CASEMust be in "SCREAMING_SNAKE_CASE" format. Only uppercase letters, digits and _ are allowed
screamingsnakecase-pointSCREAMING_SNAKE_CASE.POINTMust be in "SCREAMING_SNAKE_CASE" format. Only uppercase letters, digits, _ and . are allowed
kebabcasekebab-caseMust be in "kebab-case" format. Only lowercase letters, digits and - are allowed
kebabcase-pointkebab-case.pointMust be in "kebab-case" format. Only lowercase letters, digits, - and . are allowed
pointcasepoint.caseMust be in "point.case" format. Only lowercase letters, digits and . are allowed

CLI Rules

When adding rules via the CLI, you need to provide a valid JSON for the --rule argument. You can provide multiple rules. The JSON should follow the rules format described above.

Example: inflint --rule "{ \"src/**/*\": [1] }"

Aliases

You can use the known conventions, or you can add your own by applying aliases, via the CLI or other configuration. To use the aliases, simply use the alias name as you would use a known convention. Aliases should be applied with the following format:

CLI Aliases

When adding aliases via the CLI, you need to provide a valid JSON for the --alias argument. You can provide multiple aliases. The JSON should follow the aliases format described above.

Example: inflint --alias "{ \"myAlias\": \"^\\.\" }"

You can escape aliases regex with in the CLI if you prefix character with \\. "^\\." will match any string begins with dot (.)

CLIConfiguration keyTypedefaultDescription
-extendsString-A path to configuration file to extend configurations from
--no-inflintrc-BooleanfalseWhether Inflint ignores any configuration file
-c, --config-String-The path to a configuration file which will be used by Inflint
--rulerulesAbove-Inflint rules to use against files
--aliasaliasesAbove-Inflint aliases to use together with rules
--ignore-pathignorePathString.inflintignoreIgnore file path Inflint will use to ignore patterns
--no-ignoreignoreBooleanfalseDisable use of ignore files and patterns
--ignore-patternignorePatternsString[][]Patterns of files to ignore (in addition to those in .inflintignore)
--quietquietBooleanfalseWhether to report errors only
--max-warningsmaxWarningsNumber0Number of warnings to trigger non-zero exit code
--bailbailBoolean or Number0Number of failures (errors) to make Inflint to exit. Setting "bail" to true is the same as setting "1"
-o, --output-fileoutputFileString-Specify file to write report to
--color, --no-color-BooleantrueForce enabling/disabling of color
-h, --help-BooleanfalseShow help
-v, --version-BooleanfalseOutput the version number
--env-info-BooleanfalseOutput the environment version

Examples

Support

For support, email talrofe111@gmail.com or open an issue at inflint issues.

Contributing

Contributions are always welcome!

See CONTRIBUTING.md for ways to get started.

Please adhere to this project's CODE_OF_CONDUCT.md.

Authors

License

MIT