Feature request: Next.JS dynamic routes, slug, catch all and optional catch all support
mleimer opened this issue · comments
Feature request
Support Next.JS folder and file naming convention as a named rule.
Acceptance criteria
Folder and file names within a certain directory eg. pages
are to be considered valid if at least one of the following conventions hold true:
- kebab-case (regular pages-folders), eg.
posts
orweb-posts
- camelCase enclosed in
[]
, eg.[postId]
- or camelCase enclosed in
[...]
, where this must be a leaf node, eg.[...slug]
- or camelCase enclosed in
[[...]]
, where this must be a leaf node, eg.[[...slug]]
Current workaround
- Define own glob pattern.
Further documentation
https://nextjs.org/docs/routing/dynamic-routes
Thank you for taking the time to send me a feature request for my check-file plugin. However, after careful consideration, I have decided that the requested feature is not within the scope of my plugin.
As you mentioned, the requested rule is specific to Next.js and not applicable to my plugin, which is designed to focus solely on folder and file checks without any connection to any particular framework. Therefore, the requested rule should be included in a Next.js specific ESLint plugin.
Nevertheless, if you have created your own pattern that addresses this requirement and would like to share it with others, I would be happy to add it to the plugin's readme so that other users can benefit from your contribution.