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?
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?
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 = {}
Be careful blindly setting the node environment in all projects. If the application is not going to be running on node (e.g. a browser application), don't set the whole project to use the node environment just to prevent linting errors in the config file. It's better to just not lint this file instead, or potentially set up a different set of rules for it.
To ignore it, just add the following to the .eslintrc.js file.
'ignorePatterns': [
'.eslintrc.js'
],