DEV Community

Cover image for Use Inflint to follow files and folders convention
Tal Rofe
Tal Rofe

Posted on

Use Inflint to follow files and folders convention

INTRO

In the last months I worked with some juniors on the same project. Usually in order to overcome some bad practices and bad code, I add some linters: ESLint, Stylint, commitlint and also prettier.

It usually helps a lot and I avoid redundant code reviews for dummy things.

However, there was 1 thing I couldn't avoid. Files and folders names.
Although I had some clear convention with my file structure, other people kept on creating files and folders that did not follow the repository convention.

First thing I thought of was applying some file structure linter.
But I couldn't find any proper linter for this.
I found one which could not be applied with lint-staged and has very low maintenance and features. So.. I created my own package!

INFLINT

WHO??

It is a file system linter. This tool will scan your file structure in the repository, and validates, according to provided configuration, that the files and folders match the provided convention.

WHERE??

You can check it out here:
https://www.npmjs.com/package/inflint

Or look at the source code here:
https://github.com/Vinyl-Depository/Inflint

demo

Image description

Not only you get a lot of configurations options with the main features: "Rules" and "Aliases" but this tool can also be applied together with lint-staged:

"**/*": "inflint"
Enter fullscreen mode Exit fullscreen mode

Oldest comments (0)