Arcadio Alivio Sincero
Arcadio Alivio Sincero

Reputation: 720

eslint not catching misspelled function name defined in another module

I have in bob.js:

export let say_hello = () => {
    console.log('Hello, I'm Bob!');
};

And in main.js:

import * as bob from './bob.js';
bob.say_helo();

The function call "say_helo()" is obviously misspelled. I would like eslint to be able to catch such errors, but I seem to be unable to get it to play ball. Can anybody please tell me what should go in my .eslintrc.js file to make this happen?

Thanks!

Upvotes: 1

Views: 524

Answers (2)

Arcadio Alivio Sincero
Arcadio Alivio Sincero

Reputation: 720

In case somebody else in the future will wonder the same thing, the answer to my problem is to install the plugin eslint-plugin-import.

Upvotes: 2

Ilya Volodin
Ilya Volodin

Reputation: 11256

ESLint runs on one file at a time, and doesn't share data between files. So it's not aware of the function in the other file.

Upvotes: 0

Related Questions