Skip to content

Breaks on strict packaging setups #400

@lishaduck

Description

@lishaduck

Your environment

System:
  OS: macOS 15.4.1
  CPU: (8) arm64 Apple M1
  Memory: 112.45 MB / 8.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 23.10.0 - ~/.local/share/mise/installs/node/23.10.0/bin/node
  npm: 10.9.2 - ~/.local/share/mise/installs/node/23.10.0/bin/npm
  pnpm: 10.9.0 - ~/.local/share/mise/installs/node/23.10.0/bin/pnpm
  Watchman: 2025.04.14.00 - /opt/homebrew/bin/watchman
Managers:
  Cargo: 1.85.0 - ~/.cargo/bin/cargo
  CocoaPods: 1.16.2 - /opt/homebrew/bin/pod
  Gradle: 8.14 - /opt/homebrew/bin/gradle
  Homebrew: 4.4.32 - /opt/homebrew/bin/brew
  pip3: 21.2.4 - /usr/bin/pip3
  RubyGems: 3.0.3.1 - /usr/bin/gem
Utilities:
  CMake: 4.0.1 - /opt/homebrew/bin/cmake
  Make: 3.81 - /usr/bin/make
  GCC: 17.0.0 - /usr/bin/gcc
  Git: 2.39.5 - /usr/bin/git
  Clang: 17.0.0 - /usr/bin/clang
  FFmpeg: 7.1.1 - /opt/homebrew/bin/ffmpeg
  Curl: 8.7.1 - /usr/bin/curl
  OpenSSL: 3.3.6 - /usr/bin/openssl
Servers:
  Apache: 2.4.62 - /usr/sbin/apachectl
Virtualization:
  Docker: 24.0.6 - /usr/local/bin/docker
  Docker Compose: 2.23.0 - /usr/local/bin/docker-compose
SDKs:
  iOS SDK:
    Platforms: DriverKit 24.4, iOS 18.4, macOS 15.4, tvOS 18.4, visionOS 2.4, watchOS 11.4
  Android SDK:
    API Levels: 31, 34, 35
    Build Tools: 30.0.3, 33.0.1, 34.0.0, 35.0.0
    System Images: android-35 | Google Play ARM 64 v8a
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11005911
  IntelliJ: 2025.1
  VSCode: 1.99.3 - /opt/homebrew/bin/code
  Vim: 9.1 - /usr/bin/vim
  Xcode: 16.3/16E140 - /usr/bin/xcodebuild
Languages:
  Bash: 3.2.57 - /bin/bash
  Java: 20.0.2 - /usr/bin/javac
  Perl: 5.34.1 - /usr/bin/perl
  Python: 3.13.3 - /opt/homebrew/opt/[email protected]/libexec/bin/python
  Python3: 3.9.6 - /usr/bin/python3
  Ruby: 2.6.10 - /usr/bin/ruby
  Rust: 1.85.0 - /Users/dukese01/.cargo/bin/rustc
Databases:
  SQLite: 3.43.2 - /usr/bin/sqlite3
Browsers:
  Chrome: 135.0.7049.115
  Safari: 18.4

I know you didn't need to know all that, but it was funny output :P

Describe the bug

I'm switching a pnpm monorepo to hoist: false. Why? I'm not sure, don't judge please :)
The altruistic reason is to "find bugs", which, I mean, I did.

This code here is wrong:

export { type TSESLint } from '@typescript-eslint/utils';

sheriff doesn't have a production dependency on @typescript-eslint/utils, so this (useless) import fails at runtime.
The fix is to move the type modifier outside of the {.
Notably, @typescript-eslint/no-import-type-side-effects would've caught this, so I wonder if we want to enable that?

Project

eslint-config-sheriff

Minimal reproduction

n/a

Steps to reproduce

  1. Install eslint-config-sheriff in pnpm with hoist: false or with Yarn
  2. Try to run ESLint

Logs

Error: Cannot find module '@typescript-eslint/utils'
Require stack:
- /home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]_patch_hash=9754dbe94a035670ab47e8307bf84cf8095580f0cfe5987_d43c5c29c882ebbe2efe5fc7e2faffd4/node_modules/eslint-config-sheriff/dist/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1405:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at jitiResolve (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:187220)
    at jitiRequire (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:189288)
    at import (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:199778)
    at /home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]_patch_hash=9754dbe94a035670ab47e8307bf84cf8095580f0cfe5987_d43c5c29c882ebbe2efe5fc7e2faffd4/node_modules/eslint-config-sheriff/dist/index.js:1196:7
    at async import (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:199772)
    at async /home/runner/work/psdtools.github.io/psdtools.github.io/packages/deputy/src/index.ts:3:28
    at async import (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:199772)
    at async /home/runner/work/psdtools.github.io/psdtools.github.io/apps/petal-notes/eslint.config.ts:1:211
    at async Function.import (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected]/node_modules/jiti/dist/jiti.cjs:1:199772)
    at async loadConfigFile (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/config/config-loader.js:187:24)
    at async ConfigLoader.calculateConfigArray (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/config/config-loader.js:500:32)
    at async #calculateConfigArray (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/config/config-loader.js:663:29)
    at async directoryFilter (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:269:33)
    at async NodeHfs.<anonymous> (file:///home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/@[email protected]/node_modules/@humanfs/core/src/hfs.js:586:29)
    at async NodeHfs.walk (file:///home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/@[email protected]/node_modules/@humanfs/core/src/hfs.js:614:3)
    at async globSearch (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:323:26)
    at async Promise.allSettled (index 0)
    at async globMultiSearch (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:408:21)
    at async findFiles (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/eslint/eslint-helpers.js:587:27)
    at async ESLint.lintFiles (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/eslint/eslint.js:743:27)
    at async Object.execute (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/cli.js:528:23)
    at async main (/home/runner/work/psdtools.github.io/psdtools.github.io/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/bin/eslint.js:158:22)

Code of Conduct

I will submit a PR

  • I'd be willing to submit a PR for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThe issue is accepted and a PR can be proposed.bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions