question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning for ignored files on linting

See original GitHub issue

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)

Issue Analytics

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

github_iconTop GitHub Comments

22reactions
albertocommented, Apr 14, 2016

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.

11reactions
jhlibertycommented, May 26, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to silence warnings about ignored files in eslint
The reason why you get the warning is that by using the star, you are telling the eslint that you want to lint...
Read more >
Remove warnings when linting ignored files #15010 - GitHub
When running eslint with globs or explicit paths to files and that file is ignored in .eslintignore, a warning is shown. For example,...
Read more >
Ignoring Code - ESLint - Pluggable JavaScript Linter
Ignored File Warnings ... This message occurs because ESLint is unsure if you wanted to actually lint the file or not. As the...
Read more >
Suppressing Lint Warnings - Android Studio Project Site
To persistently configure which rules are run, you can create a file named lint.xml in the root directory of your project (next to...
Read more >
lint-staged - npm
To keep prettier from throwing errors on these files, the vendor directory should be added to prettier's ignore configuration, the .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found