.eslintrc.js 'module' is not defined

Viewed 1742

I'm getting 'module' is not defined error from the eslint in .eslintrc.js file.

What does this mean and how do I fix it?

vs code error message screenshot

2 Answers

You need to add an environment setting inside your .eslintrc.js file, i.e.:

...
env: {
    node: true
},
...

That said, the error in the .eslintrc.js file itself should only appear in Visual Studio Code, because ESLint ignores file names that start with a dot per default.

convert to es5 by writing export default { } instead of module.export = {}

Related