diff --git a/scripts/utils/generate-schema.js b/scripts/utils/generate-schema.js index 642c69ee4..fe32dde59 100644 --- a/scripts/utils/generate-schema.js +++ b/scripts/utils/generate-schema.js @@ -84,6 +84,19 @@ function optionToSchema(option) { } if (option.array) { schema = wrapWithArraySchema(schema); + + // #10274 + if (option.name === "pluginSearchDirs") { + schema = { + oneOf: [ + schema, + { + enum: [false], + description: "Disable plugin autoloading.", + }, + ], + }; + } } return { description: option.description, diff --git a/tests/integration/__tests__/__snapshots__/schema.js.snap b/tests/integration/__tests__/__snapshots__/schema.js.snap index 82d6a8ce3..d76f18954 100644 --- a/tests/integration/__tests__/__snapshots__/schema.js.snap +++ b/tests/integration/__tests__/__snapshots__/schema.js.snap @@ -281,10 +281,20 @@ This option cannot be used with --range-start and --range-end.", "description": "Custom directory that contains prettier plugins in node_modules subdirectory. Overrides default behavior when plugins are searched relatively to the location of Prettier. Multiple values are accepted.", - "items": Object { - "type": "string", - }, - "type": "array", + "oneOf": Array [ + Object { + "items": Object { + "type": "string", + }, + "type": "array", + }, + Object { + "description": "Disable plugin autoloading.", + "enum": Array [ + false, + ], + }, + ], }, "plugins": Object { "default": Array [],