Use all files in a folder like a one big JS

You didn't provide code examples in your question, but I assume you do something like this:

api.js

const api = {
  fetchData() {
    // some code that fetches data
  }
};

core.js

const core = {
  init() {
    api.fetchData();
  }
};

The ESLint rule that causes errors when you lint these JavaScript modules is the no-undef rule.

It checks for variables that are used without having been defined. In the code example core.js above, this would be api, because that is defined in another module, which ESLint doesn't know about.

You don't care about these errors, because in your actual JS bundle used in production, the code from api.js and core.js is concatenated in one bundle, so api will be defined.

So actually api in this example is a global variable.

The no-undef rule allows you to define global variables so that they won't cause errors.

There are two ways to do this:

Using Comments

At the beginning of your core.js module, add this line:

/* global api */

Using the ESLint Config

As explained here – add this to your .eslintrc file:

{
  "globals": {
    "api": "writable"
  }
}

Side Note

As some commenters to your question pointed out, it would probably be better to use import and export statements in the modules, together with a module bundling tool like webpack to create one bundle from your JavaScript modules.