Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

261
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda