Skip to content

Warning for ignored files on linting #5623

Closed
abhisekp opened this Issue · 6 comments

3 participants

@abhisekp

What version of ESLint are you using?
eslint 2.4.0

What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint 6.0.0-beta.6

Please show your full configuration:

.eslintrc.json

{
    "root": true,
    "extends": "airbnb/base",
    "rules": {
        "indent": [
            2,
            2
        ],
        "quotes": [
            0, "double"
        ],
        "linebreak-style": [
            2, "unix"
        ],
        "semi": [
            2, "always"
        ],
        "no-unused-vars": [
            1, {
                "vars": "all",
                "args": "none"
            }
        ],
        "no-var": [1],
        "no-fallthrough": [1]
    },
    "env": {
        "es6": true,
        "node": true
    },
    "ecmaFeatures": {
        "modules": true
    },
    "globals": {
        "logger": true,
        "log4js": true
    },
    "parser": "babel-eslint"
}

.eslintignore

*.min.js
build/

What did you do? Please include the actual source code causing the issue.
eslint **/*.js

What did you expect to happen?
Not to show my ignored files WARNING while linting.

What actually happened? Please include the actual, raw output from ESLint.

MyProjects/NodeApp/md-urls  create-lib-WIP ✗                           0m ↑⚑  ⍉
▶ npm run lint

> md-urls@0.0.3 lint /home/abhisekp/MyProjects/NodeApp/md-urls
> eslint **/*.js


/home/abhisekp/MyProjects/NodeApp/md-urls/bin/cli.js
  5:13  warning  'program' is defined but never used  no-unused-vars

/home/abhisekp/MyProjects/NodeApp/md-urls/build/CONTRIBUTING.js
  0:0  warning  File ignored because of a matching ignore pattern. Use --no-ignore to override

/home/abhisekp/MyProjects/NodeApp/md-urls/build/app.js
  0:0  warning  File ignored because of a matching ignore pattern. Use --no-ignore to override

/home/abhisekp/MyProjects/NodeApp/md-urls/build/index.js
  0:0  warning  File ignored because of a matching ignore pattern. Use --no-ignore to override

/home/abhisekp/MyProjects/NodeApp/md-urls/lib/app.js
  1:5  warning  'x' is defined but never used  no-unused-vars

✖ 5 problems (0 errors, 5 warnings)
@platinumazure

Workaround (only practical if you have no rules configured as warnings): Use --quiet option to suppress warnings and only print errors.

@abhisekp

@platinumazure i've rules configured as warning and i need those warnings.

@platinumazure
@alberto
ESLint member

I think it is working as expected, because of the way you are calling eslint. If you use eslint . instead, the warnings should go away.

@abhisekp

@alberto absolutely. Thanks.
But why should it gimme warning for ignored files/directories?

@alberto
ESLint member

Because there is a discrepancy between the files you are asking to lint in the command line and your ignored files. I'm actually not sure what should take precedence, but this is something we are discussing in another thread, so I'm closing this one.

@alberto alberto closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.