eslint: Warning for ignored files on linting

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)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 8
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Yes, by using eslint **/*.js (without quotes) you are explicitly including all files and asking eslint to lint them. eslint is trying to be helpful telling you that it is not linting some of the files you asked him because they are ignored.

Try using eslint . instead.

Can we add a rule to not display a warning when an ignored file is linted? It’s really frustrating to save an ignored file and see warnings thrown.

screenshot

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.

^ I agree. I don’t see any value in having this warning to begin with since the point of gitignore is to ignore files that fall within the group of files you’re linting.

@alberto What’s the point of an ignore file if it’s not to contradict what you express in the config file?

I understand- it’s a note for others who find this issue 😄 On Mar 19, 2016 5:12 PM, “Abhisek Pattnaik” notifications@github.com wrote:

@platinumazure https://github.com/platinumazure i’ve rules configured as warning and i need those warnings.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/eslint/eslint/issues/5623#issuecomment-198795768

I’d also like to support another consideration for this issue. If I’ve explicitly ignored a file in .eslintignore, I don’t need to hear about it anymore.

Yeah I just complained to JetBrains about this issue… the only workaround to prevent this issue from firing in IDEA/WebStorm is to turn off ESLint integration. Please reconsider this… it’s a really dumb idea to ‘warn’ the user that the system is working as designed.

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