Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[Feature Request] Support pattern matching for rule "file-name-casing" #4071

Closed
Ky6uk opened this issue Jul 27, 2018 · 1 comment · Fixed by #4284
Closed

[Feature Request] Support pattern matching for rule "file-name-casing" #4071

Ky6uk opened this issue Jul 27, 2018 · 1 comment · Fixed by #4284

Comments

@Ky6uk
Copy link

Ky6uk commented Jul 27, 2018

Feature request

Many projects can have different styles for naming files. For example React projects can have pascal-case rule for component files (Component.tsx, Some/Other/Component.tsx) and kebab-case rule for other files (utils/formatter.ts, helper/check-string.ts).

So I think we should extend rule file-name-casing to array of styles with filename pattern as one of arguments. For example:

file-name-casing:
  severity: 'error'
  options:
    - [/\.tsx$/, 'pascal-case']
    - [/\.style\.ts$/, 'pascal-case']
    - [/\.ts$/, 'kebab-case']
@cheeZery
Copy link
Contributor

cheeZery commented Oct 4, 2018

I'll take a shot at this one!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants