fix: Revert some un-necessary allowExcessArguments

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2026-02-16 17:38:48 +01:00
parent de62a9d322
commit e6f7ab105d
2 changed files with 3 additions and 7 deletions
+3 -4
View File
@@ -29,11 +29,10 @@ jest.mock('./paths', () => ({
}));
describe('findRoleFromCommand', () => {
function mkCommand(args: string) {
function mkCommand(args?: string) {
const parsed = new Command()
.allowExcessArguments(true)
.option('--role <role>', 'test role')
.parse(['node', 'entry.js', ...args.split(' ')]) as Command;
.parse(args?.split(' ') ?? [], { from: 'user' });
return parsed.opts();
}
@@ -49,7 +48,7 @@ describe('findRoleFromCommand', () => {
});
it('provides role info by role', async () => {
await expect(findRoleFromCommand(mkCommand(''))).resolves.toEqual(
await expect(findRoleFromCommand(mkCommand())).resolves.toEqual(
'web-library',
);
@@ -205,7 +205,6 @@ export function registerCommands(program: Command) {
program
.command('type-deps')
.description('Find inconsistencies in types of all packages and plugins')
.allowExcessArguments(true)
.action(lazy(() => import('./type-deps/type-deps'), 'default'));
program
@@ -214,7 +213,6 @@ export function registerCommands(program: Command) {
'Ensure your packages are using the correct peer dependency format.',
)
.option('--fix', 'Fix the issues found')
.allowExcessArguments(true)
.action(lazy(() => import('./peer-deps/peer-deps'), 'default'));
program
@@ -228,7 +226,6 @@ export function registerCommands(program: Command) {
'CI run checks that there are no changes to catalog-info.yaml files',
)
.description('Create or fix info yaml files for all backstage packages')
.allowExcessArguments(true)
.action(
lazy(
() => import('./generate-catalog-info/generate-catalog-info'),