Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
How can I fix import/no-default-export without switching to Typescript?

I'm trying to put all my selectors in an external JS file and then import them in to my page object when I need them e.g. :

Home-page-selectors.js:
    export default {
      headerLinks: 'header a',
      contactUsLink: "header a[href='/contact-us']",
    }

Home-page.js includes import selectors from '../test-data/home-page-data.js' I can then do things like cy.get(selectors.headerLinks)

The problem is when I run my lint tasks I get an error from Home-page-selectors.js saying

error Prefer named exports import/no-default-export

How can I fix this error? I know multiple ways I can do it in TypeScript but unfortunately switching to TS isn't an option due to a number of plugins we use not being compatible.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!