We have a check-file/folder-naming-convention
ESLint rule in our NextJS project.
"check-file/folder-naming-convention": [
"error",
{
"src/pages/**/": "KEBEB_CASE",
...
}
]
It was fine until we have a [slug]
folder for some dynamic routes.
Luckily, check-file/folder-naming-convention
supports custom pattern. Here is how we solved it:
"check-file/folder-naming-convention": [
"error",
{
"src/pages/**/": "?(\\[)+([a-z0-9-])?(\\])",
...
}
]
Top comments (0)