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

match-exported with non-default exports

Open wh1t3cAt1k opened this issue 4 years ago • 4 comments

Our company enforces the 'no-default-export' rule across the codebase. So while there is a single export from every file, it is a non-default named export.

Is there any way to use or adapt this library to check filename against non-default export?

I imagine expanding the match-exported rule applicability to files with exactly one non-default named export, continuing to ignore files that have multiple non-default exports.

If needed, to avoid breaking changes, this could be done as a configuration switch in the rule.

wh1t3cAt1k avatar Jul 23 '20 13:07 wh1t3cAt1k

I'm looking for this also

philostler avatar Dec 12 '20 13:12 philostler

+1

Also trying to figure out a way to enforce this. I'd prefer to be able to use the import/no-default-export rule along with the filename/match-exported rule so that the file name, export name, and import name can all match for things like React components. I realize this project is no longer active but, I'm curious if anyone has figured out a way to do something like this.

jasontk19 avatar Dec 15 '20 16:12 jasontk19

+1

sublimeye avatar May 04 '23 00:05 sublimeye