[SOLVED] How can I enforce filename and folder name convention in typescript eslint?


I am using eslint for typescript convention. And I checked this rule https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md which only works for code.

I am looking for a rule which can enforce filename to be camelCase and folder name to be snake_case. How can I set this rule in typescript?


Eslint doesn’t implement by default the file name check, see this github issue from 2015.

Some plugins do like eslint-plugin-unicorn or eslint-plugin-filenames.

Because Tslint is now deprecated, they created the project typescript-eslint, which is handling file naming casing, you could check it out 🙂

Answered By – Orelsanpls

Answer Checked By – Marilyn (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *