{"record":{"id":"48db43f87bcea5f1","repo":"jestjs/jest","slug":"the-ignoreprojects-option-requires-the-name-of-a","errorCode":null,"errorMessage":"The --ignoreProjects option requires the name of at least one project to be specified.\nExample usage: jest --ignoreProjects my-first-project my-second-project","messagePattern":"The --ignoreProjects option requires the name of at least one project to be specified\\.\nExample usage: jest --ignoreProjects my-first-project my-second-project","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/jest-cli/src/args.ts","lineNumber":71,"sourceCode":"    argv.maxWorkers === undefined\n  ) {\n    throw new Error(\n      'The --maxWorkers (-w) option requires a number or string to be specified.\\n' +\n        'Example usage: jest --maxWorkers 2\\n' +\n        'Example usage: jest --maxWorkers 50%\\n' +\n        'Or did you mean --watch?',\n    );\n  }\n\n  if (argv.selectProjects && argv.selectProjects.length === 0) {\n    throw new Error(\n      'The --selectProjects option requires the name of at least one project to be specified.\\n' +\n        'Example usage: jest --selectProjects my-first-project my-second-project',\n    );\n  }\n\n  if (argv.ignoreProjects && argv.ignoreProjects.length === 0) {\n    throw new Error(\n      'The --ignoreProjects option requires the name of at least one project to be specified.\\n' +\n        'Example usage: jest --ignoreProjects my-first-project my-second-project',\n    );\n  }\n\n  if (\n    argv.config &&\n    !isJSONString(argv.config) &&\n    !new RegExp(\n      `\\\\.(${constants.JEST_CONFIG_EXT_ORDER.map(e => e.slice(1)).join('|')})$`,\n      'i',\n    ).test(argv.config)\n  ) {\n    throw new Error(\n      `The --config option requires a JSON string literal, or a file path with one of these extensions: ${constants.JEST_CONFIG_EXT_ORDER.join(\n        ', ',\n      )}.\\nExample usage: jest --config ./jest.config.js`,\n    );","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/jestjs/jest/blob/8e6d128e4a278059ecddecaa97400b04c8ae5fd9/packages/jest-cli/src/args.ts#L53-L89","documentation":"Symmetric to --selectProjects, check() requires --ignoreProjects (args.ts:70-75) be given at least one project displayName. The flag filters projects OUT of the run; an empty list is meaningless, so Jest rejects it immediately.","triggerScenarios":"Running jest --ignoreProjects with no names; an empty interpolation in a script; CI matrix computing an ignore list that came up empty.","commonSituations":"Excluding a noisy project conditionally where the condition produced no names; aliasing selectProjects/ignoreProjects incorrectly; copy-paste from docs without args.","solutions":["Pass at least one project displayName: jest --ignoreProjects my-first-project.","Verify the displayName of each project you intend to ignore matches what's in the config.","When the ignore list is dynamic and empty, omit the flag entirely instead of passing --ignoreProjects."],"exampleFix":"// before\njest --ignoreProjects\n// after\njest --ignoreProjects my-first-project my-second-project","handlingStrategy":"validation","validationCode":"function ignoreProjectsArg(names: string[]): string[] {\n  if (names.length === 0) throw new Error('--ignoreProjects needs >= 1 name');\n  return ['--ignoreProjects', ...names];\n}","typeGuard":"function isNonEmptyStringArray(v: unknown): v is string[] {\n  return Array.isArray(v) && v.length > 0 && v.every(x => typeof x === 'string');\n}","tryCatchPattern":null,"preventionTips":["Validate the project names exist as displayNames in your config.","Omit the flag when the ignore list resolves to empty.","Document which projects are commonly ignored in your README."],"tags":["jest-cli","cli-args","ignoreprojects","multi-project","missing-argument"],"backgroundTag":null,"analyzedSha":"8e6d128e4a278059ecddecaa97400b04c8ae5fd9","analyzedAt":"2026-08-10T18:11:27.960Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}