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
[6.7] running eslint through npm script throws error. #12604
[6.7] running eslint through npm script throws error. #12604
Comments
I have the same problem but with eslint-prettier-plugin.
Should I downgrade the eslint to the previous release? |
Same here. I was updating the dependencies today and the error pop up when testing with
I then installed a previous version |
Hi. Thank you for your reports. Would you provide the repro steps from scratch? Thanks. |
npm init
npm install --save-dev eslint eslint-config-adpyke-es6 create {
"extends": "adpyke-es6"
} add the following script to "lint": "eslint ." run |
also it might be important to have a .eslintrc in your home folder as well? so if this doesn't work try adding .eslintrc to your home folder with the same contents |
Thank you. Hmm, I put |
can I see your package.json? |
{
"name": "sandbox",
"version": "0.0.0",
"description": "",
"main": "index.js",
"files": [],
"scripts": {
"try": "eslint ."
},
"keywords": [],
"author": "Toru Nagashima <public@mysticatea.dev>",
"license": "MIT",
"dependencies": {
"eslint": "^6.7.1",
"eslint-config-adpyke-es6": "^1.4.13"
}
} |
that looks right. And you have an .eslintrc in both your project folder and your home folder? |
Yes, I have tried either and both. |
I have an
And also have a In which I have the following structure:
In config file:
Script in |
Ah, OK, I have found what it happens. Thank you for providing the information. This happens under the following conditions:
In the situation, first, ESLint has checked if the directory is ignored or not. Previously this process loads only I think it's not intuitive if |
Side note: As you may know, we have deprecated the config files in HOME directory. The error of this issue looks like thrown from unused config files in HOME directory (because it should not work since ESLint 6.0.0, I guess that you have not used it while a time), therefore I'd like to recommend to remove it. |
You can replace "scripts": {
"lint": "eslint ."
} by "scripts": {
"lint": "eslint $(pwd)/."
} |
I don't experience the issue when using eslint v6.6.x.
I have the following script in my package.json:
If I run
eslint .
directly in the console it works correctly, but when I runnpm run lint
, it throws an error. It seems like it's using the wrong config?The text was updated successfully, but these errors were encountered: