diff --git a/lib/config/flat-config-schema.js b/lib/config/flat-config-schema.js index 10d6b50ef1ff..a97d0417900a 100644 --- a/lib/config/flat-config-schema.js +++ b/lib/config/flat-config-schema.js @@ -188,18 +188,6 @@ function assertIsRuleSeverity(ruleId, value) { } } -/** - * Validates that a given string is the form pluginName/objectName. - * @param {string} value The string to check. - * @returns {void} - * @throws {TypeError} If the string isn't in the correct format. - */ -function assertIsPluginMemberName(value) { - if (!/[@a-z0-9-_$]+(?:\/(?:[a-z0-9-_$]+))+$/iu.test(value)) { - throw new TypeError(`Expected string in the form "pluginName/objectName" but found "${value}".`); - } -} - /** * Validates that a value is an object. * @param {any} value The value to check. @@ -323,7 +311,9 @@ const processorSchema = { merge: "replace", validate(value) { if (typeof value === "string") { - assertIsPluginMemberName(value); + if (value.includes("/") === -1) { + throw new TypeError(`Expected string in the form "pluginName/processorName" but found "${value}".`); + } } else if (value && typeof value === "object") { if (typeof value.preprocess !== "function" || typeof value.postprocess !== "function") { throw new TypeError("Object must have a preprocess() and a postprocess() method.");