Ignore specific error for eslint in the whole project

Viewed 2187

I'm using AdonisJs (NodeJS framework) and they created a function called use to import file like they'd be namespaces, for example use('App/Services/User') instead of require('../app/Services/User').

The problem is that eslint will throw the error 'use' is not defined no-undef.

At this time I have two ways:

  1. Putting an eslint comment to disable alert for that line in each file, but it's annoying
  2. Use require instead of use, but it's a lot useful the function.

Is there a way to disable "one time for all" the specific no-undef for the use function in the whole project?

2 Answers

Take a look at globals sections at .eslintrc config.

{
    "globals": {
        "use": false
    }
}
Related