You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an application based on yarn 3 + pnp mode, add lint-staged, configure it and then run
yarn run lint-staged
Debug Logs
expand to view
[PATH TO MY APP]/.yarn/cache/lint-staged-npm-14.0.1-50e37043be-8c5d740cb3.zip/node_modules/lint-staged/lib/loadConfig.js:4
import { lilconfig } from 'lilconfig'
^^^^^^^^^
SyntaxError: Named export 'lilconfig' not found. The requested module 'lilconfig' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'lilconfig';
const { lilconfig } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:122:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:188:5)
at async CustomizedModuleLoader.import (node:internal/modules/esm/loader:228:24)
at async loadESM (node:internal/process/esm_loader:40:7)
at async handleMainPromise (node:internal/modules/run_main:66:12)
Node.js v20.5.1
Environment
OS: macOS Ventura 13.5.1
Node.js: 20.5.1
lint-staged: 14.0.1
The text was updated successfully, but these errors were encountered:
Hello, yes, Pull request is welcome! I would just move the const { lilconfig } = pkg line after all the imports, to keep the imports nicely separate from other code. 👍
Description
In a project using yarn 3.6.3 in pnp mode, I'm not able to use husky + lint-staged as pre-commit hook.
My .yarnrc.yml file:
Relevant section in package.json
Steps to reproduce
Create an application based on yarn 3 + pnp mode, add lint-staged, configure it and then run
Debug Logs
expand to view
Environment
lint-staged
: 14.0.1The text was updated successfully, but these errors were encountered: