question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linting doesn't work on Windows when node_modules is present in folder

See original GitHub issue

What version of ESLint are you using? v2.6.0 What parser (default, Babel-ESLint, etc.) are you using? default Please show your full configuration:

{
    "rules": {
        "semi": [
            2,
            "always"
        ]
    }
}

What did you do? Please include the actual source code causing the issue.

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ node -v
v4.2.1

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ npm -v
2.14.7

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ eslint -v
v2.6.0

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ ls -la
total 10
drwxr-xr-x 1 filipe.silva filipe.silva  0 Apr  4 12:50 ./
drwxr-xr-x 1 filipe.silva filipe.silva  0 Apr  4 12:36 ../
-rw-r--r-- 1 filipe.silva filipe.silva 89 Apr  4 12:37 .eslintrc.json
-rw-r--r-- 1 filipe.silva filipe.silva 11 Apr  4 12:38 test.js

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ cat .eslintrc.json
{
    "rules": {
        "semi": [
            2,
            "always"
        ]
    }
}

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ cat test.js
var a = 1

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ eslint ./**/*.js

E:\sandbox\eslint-test\test.js
  1:10  error  Missing semicolon  semi

✖ 1 problem (1 error, 0 warnings)


filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ mkdir node_modules

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ cp test.js node_modules/test.js

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$ eslint ./**/*.js

filipe.silva@DESKTOP-7ND6T3R MINGW64 /E/sandbox/eslint-test
$

What did you expect to happen? I expected that running eslint ./**/*.js the second time would show the same result as the first time. What actually happened? Please include the actual, raw output from ESLint. Nothing was shown when running the command a second time.

This was run on a win10 machine using githbash.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
filipesilvacommented, Apr 5, 2016

Would just like to say thanks for all the help. You found a solution for my issue, got to the bottom of it and even added docs. Very cool. Cheers!

0reactions
albertocommented, Apr 5, 2016

Yes, by quoting it, the argument is passed as a literal.

$ eslint '**/*.js'
[ '/Users/alberto/.nvm/versions/node/v5.9.1/bin/node',
  '/Users/alberto/.nvm/versions/node/v5.9.1/bin/eslint',
  '**/*.js' ]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Lint task: doesn't work without `node_modules` in workspace ...
I am working on a multiplayer game project, and the client- and server-side logic are included in separate root folders of my repository....
Read more >
Eslint not ignoring node_modules folder - Stack Overflow
In my case, ESLint (v7.8.1) was ignoring node_modules directories properly, but not my dist directory. I added this to .eslintignore :
Read more >
CLI - Prettier
This command formats all files supported by Prettier in the current directory and its subdirectories. It's recommended to always make sure that prettier...
Read more >
Husky - Git hooks
Husky improves your commits and more woof! You can use it to lint your commit messages, run tests, lint code, etc... when you...
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
At first, when we run ./node_modules/.bin/rollup -c , nothing seems to be happening. That's because as it stands, the app's code passes the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found