knip: Error: is not a valid owner name in rule * @username

Hello,

I was playing around with the CLI in my local project, and I got an error when running it in the following context:

command:

pnpx knip --reporter json --include files,duplicates

output:

failed to load codeowners file from C:\coding-work\halo-discord\halo-discord-bot\.github\CODEOWNERS Error:  is not a valid owner name in rule * @elijaholmos
    at createMatcherCodeownersRule (C:\Users\eliol\AppData\Local\pnpm\store\v3\tmp\dlx-19668\node_modules\.pnpm\@snyk+github-codeowners@1.0.0\node_modules\@snyk\github-codeowners\dist\lib\ownership\OwnershipEngine.js:72:23)
    at Function.FromCodeownersFile (C:\Users\eliol\AppData\Local\pnpm\store\v3\tmp\dlx-19668\node_modules\.pnpm\@snyk+github-codeowners@1.0.0\node_modules\@snyk\github-codeowners\dist\lib\ownership\OwnershipEngine.js:50:28)
    at exports.default (C:\Users\eliol\AppData\Local\pnpm\store\v3\tmp\dlx-19668\node_modules\.pnpm\knip@0.9.1\node_modules\knip\dist\reporters\json.js:21:106)
    at async run (C:\Users\eliol\AppData\Local\pnpm\store\v3\tmp\dlx-19668\node_modules\.pnpm\knip@0.9.1\node_modules\knip\dist\cli.js:62:9)

knip.json:

{
	"dev": true,
	"entryFiles": ["index.js"],
	"projectFiles": ["/**/*.js"]
}

The project I’m testing knip in is open-source and can be found at https://github.com/elijaholmos/halo-discord-bot. In my CODEOWNERS file, I’m using the global owners syntax, as specified here.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Thanks! v0.13.3