eslint-plugin-filenames icon indicating copy to clipboard operation
eslint-plugin-filenames copied to clipboard

How to check for this pattern: componentService --> component.service.js?

Open snicol-icanbwell opened this issue 2 years ago • 2 comments

The company I work at follows a pattern where service component filenames end with "component.service.js", but the default exported component is named "componentService". I've tried using the filename replace functionality to where I strip out the last period from the filename and have it do a comparison, but because of the casing it doesn't work: componentService --> componentservice

Any ideas how I might be able to check for this file pattern?

snicol-icanbwell avatar Dec 02 '21 20:12 snicol-icanbwell

Looks like adding support for dot casing would solve my problems if this were approved.

https://github.com/selaux/eslint-plugin-filenames/pull/34

snicol-icanbwell avatar Dec 02 '21 20:12 snicol-icanbwell

As an alternative you can use https://github.com/Igorkowalski94/eslint-plugin-project-structure has the same capabilities + force only folders/files, has a built-in case for name, regex support, ability to inherit the name from the parent (the child inherits the name of the folder in which it is located), folder recursion (You can nest a given folder structure recursively) and eslint realtime errors.

Igorkowalski94 avatar Oct 01 '23 08:10 Igorkowalski94