.eslintignore file not working

Viewed 20376

I'm using a Vue template project that uses ESLint. I'd like to turn it off, so I followed these instructions and made a file with

**/*.js

called .eslintignore inside of my project root. However, I'm still getting the same eslint error messages. What am I doing wrong?

4 Answers

For my configuration - I needed to add the "ignorePatterns" property in .eslintrc:

"ignorePatterns": "**/*.d.ts"

You should use **/* instead of **/*.js as the first will ignore both .js and .vue files.

Alternatively you can comment this whole block in your build/webpack.base.conf.js

{
  test: /\.(js|vue)$/,
  loader: 'eslint-loader',
  enforce: "pre",
  include: [resolve('src'), resolve('test')],
  options: {
      formatter: require('eslint-friendly-formatter')
  }
}

If you're using the vscode-eslint plugin, the .eslintignore file may need to be placed at the root of the workspace folder, in order to be recognized by the vscode plugin.

I love ESLint but sometimes you want it to completely ignore a whole file. Add this to the top of your file:

/* eslint-disable */

It needs to be in /* this kind */ of comment, not // this kind.

And ESLint won't complain about your file any more!

Related