Globally disable eslint “import/no-anonymous-default-export” on vscode

Chris Perry
Oct 13, 2022

--

Why? Because I can.

Allow me to introduce you to the coolest default override in the world: anonymous default exports.

Looking at the code block above, there’s something gracefully compact about a file whose only export is the default of a nameless name.

If you use VSCode, it’s easy to override across your entire dev environment:

Step 1: On VSCode, open your user preference settings.json

Step 2: Add this:

"eslint.options": {
"import/no-anonymous-default-export": [
"error",
{
"allowArray": true,
"allowArrowFunction": true,
"allowAnonymousClass": true,
"allowAnonymousFunction": true,
"allowCallExpression": true, // The true value here is for backward compatibility
"allowLiteral": true,
"allowObject": true
}
]
},

That’s it!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Chris Perry
Chris Perry

Written by Chris Perry

Software Engineer II at Narvar, Inc.

No responses yet

Write a response