I am trying to convert my eslint config from json to JavaScript.
After exporting a config object from .eslintrc.js like it sys in the docs:
JavaScript - use .eslintrc.js and export an object containing your configuration.
I get the error:
(function (exports, require, module, __filename, __dirname) { export default {
^^^^^^
SyntaxError: Unexpected token export
at new Script (vm.js:83:7)
This is the first couple of lines of my config:
export default {
env: {
browser: true,
How can I fix the error?
Update
I have named the object and exported the const but get this error:
const config = {
env: {
export default config;
^^^^^^
SyntaxError: Unexpected token export
at new Script (vm.js:83:7)