We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ff6cf5 commit a291621Copy full SHA for a291621
src/rules/no-import-module-exports.js
@@ -4,7 +4,13 @@ import pkgUp from 'pkg-up';
4
5
function getEntryPoint(context) {
6
const pkgPath = pkgUp.sync(context.getFilename());
7
- return require.resolve(path.dirname(pkgPath));
+ try {
8
+ return require.resolve(path.dirname(pkgPath));
9
+ } catch (error) {
10
+ // Assume the package has no entrypoint (e.g. CLI packages)
11
+ // in which case require.resolve would throw.
12
+ return null;
13
+ }
14
}
15
16
module.exports = {
0 commit comments