Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

81
Vistas
Restrict importing specific named exports in TypeScript project

I have a react-native project I am building with TypeScript, and react-native exports an Alert class that takes some arguments and displays an alert message to the user. I needed an Alert component with more capabilities than the one provided by react-native, so I built one, styled it to match the rest of the app, and refactored the whole project to use that one instead. I also called it Alert and it takes similar arguments.

Now, though, I would like to restrict other devs from importing Alert from 'react-native' by displaying an error, even if just a linting error, and direct them to import from '/Alert' instead. This will ensure all alerts in the app look the same.

How do I go about doing this? From what I've seen, it looks like there are several solutions that allow developers to restrict imports to specific modules from specific files, but I don't want to restrict the entire 'react-native' modules as every single component needs to import at least one or two things from it (Like View, Text, etc)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda