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

[filename-match-exported] add kebab filename export for react components

Open Enase opened this issue 2 years ago • 2 comments

Is there any chance to add an ability to have kebab filename for pascal type of export (react component)?

Rule sample: "canonical/filename-match-exported": [ 2, { "transforms": "kebab" } ]

Filename sample: thumb-up.tsx

Export sample: export default ThumbUp

Current state: Error: 1:1 error Filename 'thumb-up' must match the exported and transformed name 'thumbUp' canonical/filename-match-exported

Expected: No error

Enase avatar Feb 23 '23 02:02 Enase

PS: with { transforms: ['null', 'camel'] } I have error: Filename 'thumb-up' must match any of the exported and transformed names 'ThumbUp', 'thumbUp' canonical/filename-match-exported

Enase avatar Feb 23 '23 03:02 Enase