Piotr Perak
Piotr Perak

Reputation: 11088

ESlint ignores directories when called from npm script

In my package.json I have:

"scripts": {                            
       "lint": "eslint --debug components"   
}                                      

When I run it with npm run lint I see this

> eslint --debug components
eslint:cli Running on files +0ms
eslint:glob-util Creating list of files to process. +39ms
eslint:ignored-paths Looking for ignore file in c:\dev\Monies +6ms
eslint:ignored-paths Could not find ignore file in cwd +1ms
eslint:cli-engine Linting complete in: 13ms +5ms

So it ignores my dir.

It does work as expected when I run it from command line.

node_modules\.bin\eslint --debug compoments

eslint:cli Running on files +0ms
eslint:glob-util Creating list of files to process. +39ms
eslint:ignored-paths Looking for ignore file in c:\dev\Monies +5ms
eslint:ignored-paths Could not find ignore file in cwd +1ms
eslint:cli-engine Processing c:\dev\Monies\compoments\Header.js +15ms
eslint:cli-engine Linting c:\dev\Monies\compoments\Header.js +2ms
eslint:config Constructing config for c:\dev\Monies\compoments\Header.js +1ms

Why it doesn't work with npm run?

Upvotes: 0

Views: 201

Answers (1)

Łukasz Wiśniewski
Łukasz Wiśniewski

Reputation: 111

It looks like you have a typo in the directory name:

eslint --debug components

versus

node_modules\.bin\eslint --debug compoments

components != compoments

Upvotes: 3

Related Questions