diff --git a/packages/eslint-plugin/rules/no-undeclared-imports.js b/packages/eslint-plugin/rules/no-undeclared-imports.js index 06f0afed46..05a10fb9f9 100644 --- a/packages/eslint-plugin/rules/no-undeclared-imports.js +++ b/packages/eslint-plugin/rules/no-undeclared-imports.js @@ -180,7 +180,7 @@ module.exports = { // The security implication of this is a bit interesting, as crafted add-import // directives could be used to install malicious packages. However, the same is true // for adding malicious packages to package.json, so there's significant difference. - execFileSync('yarn', ['add', ...(flag || []), ...names], { + execFileSync('yarn', ['add', ...([flag] || []), ...names], { cwd: localPkg.dir, stdio: 'inherit', });