Skip to content

Eslint glob (**) is not considering all directories recursively

I am using OSX, in my package.json file I have the script entry:

"lint": "eslint ./src/**/*.js"

However, when I run npm lint only the 1st level of directories are being considered for linting, eg. ./src/dir/* not ./src/dir/nested_dir/*.

I was under the impression that ** glob indicated recursive search?

Does anyone know how I can make this behave as expected?

Answer

Some Googling turned up this thread on Github:

Before (not working): "lint": "eslint ./src/**/*.js"

After (working): "lint": "eslint './src/**/*.js'"