gajus / eslint-plugin-canonical

ESLint rules for Canonical ruleset.
Other
124 stars 7 forks source link

Kebab filename export for react components #18

Open Enase opened 1 year ago

Enase commented 1 year ago

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 commented 1 year ago

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