Skip to content

Commit

Permalink
fix(linter): ensure package detection works in PnP (#18394)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Aug 3, 2023
1 parent 24b1ab5 commit 5634d55
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/eslint-plugin/src/utils/config-utils.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { accessSync } from 'fs';

/**
* Checks if package is available
* @param name name of the package
* @returns
*/
export function packageExists(name: string): boolean {
try {
// TODO(meeroslav): This will not work once we start using yarn Berry with PnP
accessSync(`./node_modules/.bin/${name}`);
require.resolve(name);
return true;
} catch (e) {
} catch {
return false;
}
}

1 comment on commit 5634d55

@vercel
Copy link

@vercel vercel bot commented on 5634d55 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.