-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ComponentName/ComponentName.tsx #59
Comments
I could also envision something akin to: ls:
src/components:
.dir: PascalCase
"*":
.tsx: dir
.module.scss: dir ... |
On more thought, I do like the pattern matching idea. I actually have a pattern in my codebase where the file root matches a directory that isn't the immediate parent. I'll pull from regex and use parens to represent the match groups. I envision the references would be localized to the file path in question. ls:
src/components:
(*):
.dir: PascalCase
.module.scss: $1
.tsx: $1
__tests__:
.spec.tsx: $1 |
Found alternative with eslint, until this is resolved - https://www.npmjs.com/package/eslint-plugin-check-file with "rules": {
"check-file/filename-naming-convention": [
"error",
{
"**/!(hooks)/!(index).*": "<1>",
"**/**/!(hooks)/!(index).*": "PASCAL_CASE"
},
{ "ignoreMiddleExtensions": true }
]
} It's also possible to customize error message to make it more readable |
fyi: i will definitely support this in the future |
I don’t know how to call this requirement, but in a lot of React projects you’ll see the following pattern:
Within the folder:
./src/components/ComponentName
you’ll find:ComponentName.tsx
andComponentName.module.scss
.So the containing folder’s name is the name of the files within it.
I suggest the following syntax:
Hope this is clear enough, and that I haven’t missed this option somehow.
The text was updated successfully, but these errors were encountered: