New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v11.2.4 is broken for config .lintstagedrc #1032
Comments
Please post your debug logs from |
Sure, I can downgrade and try again but I don't remember seeing anything in the log. kinda what I meant by |
I'm having something similar on unix. EDIT
|
Probably related to this: #981. Let me open a revert PR. |
Hmm, I cannot reproduce this myself on macOS 11.6.
Can you try if |
Have the same issue with 11.2.4 - exit 1 without any output. maxOS 11.6, yarn 3.0.2 --version & --help work as expected |
@w3nda or @VladimirGrenaderov, can you try editing So edit this file +++ try {
const resolved = configObject
? { config: configObject, filepath: '(input)' }
: await loadConfig(configPath)
+++ } catch (error) {
+++ console.error(error)
+++ process.exit(1)
+++ } This might indicate if the bug is indeed with |
@iiroj yes, I am getting this error
|
@w3nda That looks like the https://github.com/okonet/lint-staged/blob/04529e2b9040adc54cc8e5efc66b95bc0023477c/lib/index.js#L50 Do you have the module installed? Maybe you could try removing your node_modules and reinstalled if not. |
I have |
Are you by chance using |
But it should be reflected in documentation, right? I use .yaml too. |
No, I am not using
|
@VladimirGrenaderov there was a compatibility "fix" in PR #981 that should have handled the yaml configurations, but it seems to be broken. I now managed to replicate the bug so I'll try and come up with a fix. Sorry about that! |
Hey everyone! Ran into the same issue on Linux. I think the issue is with the Hope this helps! |
Thanks @kelvindecosta, I opened a PR that will fix the issue: #1033 |
I can also confirm this is an issue in our projects. OSX 11.6, Node 16.10.0, |
I was confused. |
Works, thanks! 🙌 |
Hey @aaronadamsCA, you mean it works with v11.2.5, don't you? Update: yeah I can confirm that it works with v11.2.5 |
@kelvindecosta I was confused i have some issue i try to use your advice but i can't find where |
While i run with `$ npx lint-staged --debug ✖ yarn lint:fix: ✖ yarn prettier:fix: |
Hey @si-saaref
{
".{js,jsx}": "yarn lint:fix",
".{js,jsx,json,css,md}": "yarn prettier:fix"
} As for your error, npm i -g yarn Hope this helps! |
@kelvindecosta Yes i have created .lintstagedrc.json with the content as you said and also install yarn globally.. |
Hey @si-saaref, the bug described in this issue was fixed as of v11.2.5. If you're using an updated version of This isn't a great place to ask for general support. But, I've included some below anyway. It looks like you're trying to use two different package managers at once:
You should choose one package manager for your project and stick with it. Each has its advantages and disadvantages. At a very high level, Yarn 3 is easier to use, but harder to set up; NPM 8 is built into Node.js 16, but harder to use. If you want to use NPM, you will run {
".{js,jsx}": "npm run-script lint:fix",
".{js,jsx,json,css,md}": "npm run-script prettier:fix"
} And then going forward, any time you see a command that includes Package management is one of the least welcoming aspects of the Node.js ecosystem. Many docs and tutorials will assume you use either NPM or Yarn (and often older, incompatible versions, too). But once you learn how to adjust commands for your package manager of choice, it should be smooth sailing. If you need further assistance, I'd recommend searching and asking on Stack Overflow: https://stackoverflow.com/tags/node.js |
"scripts": { try this |
Description
Steps to reproduce
npx lint-staged
v11.2.3
Environment
lint-staged
: v11.2.4The text was updated successfully, but these errors were encountered: