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.

Gatsby's .eslintignore being ignored

See original GitHub issue

Gatsby version: 0.12.45

Hi, I noticed that npm test on master fails due to some linting problems in interfaces folder, however this folder is actually specified in .eslintignore. But because linting is configured with --ignore-path .gitignore in package.json, .eslintignore is ignored in favour of .gitignore.

{
  "scripts": {
    "lint": "eslint --ext .js,.jsx --ignore-path .gitignore ."
  }
}

From ESLint docs:

Keep in mind that specifying --ignore-path means that any existing .eslintignore file will not be used.

Short of copying the contents of .gitignore into .eslintignore, I’m not sure what the best way to combine .eslintignore and .gitignore is.

You can scroll to the bottom of this recent build log to see the exact error

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
KyleAMathewscommented, Apr 23, 2017

Heh, our brain waves connected!

1reaction
KyleAMathewscommented, Apr 22, 2017

So it turns out you can add multiple --ignore-path! https://github.com/gatsbyjs/gatsby/commit/bd068fde91dedb74fa0e863a9000900c50fce61e 😃

https://travis-ci.org/gatsbyjs/gatsby/builds/224775750

Thanks for doing the background research on this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using ESLint - Gatsby
ESLint is an open source JavaScript linting utility. Code linting is a type of static analysis that is frequently used to find problematic...
Read more >
Ignoring ESLint - next.config.js
Ignoring ESLint. When ESLint is detected in your project, Next.js fails your production build ( next build ) when errors are present.
Read more >
Ignoring Code - ESLint - Pluggable JavaScript Linter
You can tell ESLint to ignore specific files and directories by creating a .eslintignore file in your project's root directory. The .eslintignore file...
Read more >
Migrating from TSLint to ESLint on Gatsby | by E.Y. - Medium
The whole migration process is split into three parts: ... In this case, you might want to add eslint ignore . After clearing...
Read more >
"parserOptions.project" has been set for @typescript-eslint ...
... to lint the file that is mentioned in the error (e.g. babel.config.js ), you can ignore it adding its name to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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