Skip to content

Commit

Permalink
prep: update findPluginsInNodeModules() to work more like a pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Oct 30, 2019
1 parent bbfbaf6 commit 01c94f1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/common/load-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,19 @@ function loadPlugins(plugins, pluginSearchDirs) {
}

function findPluginsInNodeModules(nodeModulesDir) {
const pluginPackageJsonPaths = globby.sync(
[
"prettier-plugin-*/package.json",
"@*/prettier-plugin-*/package.json",
"@prettier/plugin-*/package.json"
],
{ cwd: nodeModulesDir }
return (
globby
.sync(
[
"prettier-plugin-*/package.json",
"@*/prettier-plugin-*/package.json",
"@prettier/plugin-*/package.json"
],
{ cwd: nodeModulesDir }
)
// post-processing:
.map(path.dirname)
);
return pluginPackageJsonPaths.map(path.dirname);
}

function isDirectory(dir) {
Expand Down

0 comments on commit 01c94f1

Please sign in to comment.