Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.eslintignore file not working

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?

like image 411
David J. Avatar asked Nov 11 '17 10:11

David J.


People also ask

What is .eslintignore file?

The . eslintignore File. You can tell ESLint to ignore specific files and directories by creating an .eslintignore file in your project's root directory. The .eslintignore file is a plain text file where each line is a glob pattern indicating which paths should be omitted from linting.

How do you bypass ESLint?

How do I turn off rule ESLint? If you want to disable an ESLint rule in a file or on a specific line, you can add a comment. On a single line: const message = 'foo'; console. log(message); // eslint-disable-line no-console // eslint-disable-next-line no-console console.

How do I ignore ESLint errors?

Ignore multiple files or folders To turn off ESLint in the whole file, you can add /* eslint-disable */ in the first line of that file. Alternatively, you can create a file . eslintignore in the root catalog.

What is Ignorepatterns?

Ignore patterns inform the version control feature about which directories, files, and file types to not include in the version control repository. By default, files larger than 5MBs are ignored, and the following directories and file extensions are also ignored: /cbases/*


2 Answers

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')
  }
}
like image 108
samayo Avatar answered Sep 28 '22 04:09

samayo


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

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

like image 30
Nikita Jerschow Avatar answered Sep 28 '22 06:09

Nikita Jerschow