Skip to content

Commit e9c4a45

Browse files
committed
fix: incorrect error message
1 parent 5f0a83b commit e9c4a45

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/config-helpers/src/define-config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function findPluginConfig(config, pluginConfigName) {
265265
}
266266
}
267267

268-
// If it's a legacy config, or the config does not exsist => look for the flat version
268+
// If it's a legacy config, or the config does not exist => look for the flat version
269269
const flatConfig = plugin.configs?.[`flat/${configName}`];
270270
if (
271271
flatConfig &&
@@ -280,9 +280,10 @@ function findPluginConfig(config, pluginConfigName) {
280280
}
281281

282282
// If we get here, then the config was either not found or is a legacy config
283-
const message = directConfig
284-
? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
285-
: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
283+
const message =
284+
directConfig || flatConfig
285+
? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
286+
: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
286287
throw new TypeError(message);
287288
}
288289

0 commit comments

Comments
 (0)