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?
Some Googling turned up this thread on Github:
Before (not working): "lint": "eslint ./src/**/*.js"
After (working): "lint": "eslint './src/**/*.js'"
Try this instead:
"lint": "eslint src --ext .js"
Or for more than one extension:
"lint": "eslint src --ext .js,.jsx,.ts,.tsx"
See more info on eslint's docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With