codeowners icon indicating copy to clipboard operation
codeowners copied to clipboard

feat: support Next.js/Nuxt.js-style dynamic route parameters in patterns

Open azhukov-gyg opened this issue 6 months ago • 0 comments

This PR adds support for Next.js/Nuxt.js-style dynamic route parameters in CODEOWNERS patterns, addressing issue #42.

Modern web frameworks like Next.js and Nuxt.js use square brackets [paramName] in file and directory names to denote dynamic route parameters. This is a fundamental pattern in these frameworks' file-based routing systems. Examples:

/pages/users/[userId].js              # Dynamic user page
/pages/[category]/[productId].js      # Dynamic product in category
/api/[supplierId]/performance/*.ts    # API endpoints with supplier context

Currently, CODEOWNERS rejects such patterns with an error:

unexpected character '[' at position X

azhukov-gyg avatar Jul 07 '25 11:07 azhukov-gyg