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

205
Vistas
TypeScript: Import type from parent project root into my package in node_modules

I'm authoring a library with a configuration that I want to make customizable by adding a .prtcls.config.js file in the root of the project. When my library gets installed, it exists within the project's node_modules folder.

Even though I can point to the right file for the import, I get the following TS error:

File '/path/to/project/.prtcls.config.js' is not under 'rootDir' '/path/to/project/node_modules/prtcls'. 'rootDir' is expected to contain all source files.ts(6059)

Here's the tsconfig in the /node_modules/prtcls folder:

{
  "compilerOptions": {
    "allowJs": true,
    "alwaysStrict": true,
    "checkJs": true,
    "declaration": true,
    "incremental": true,
    "target": "ESNext",
    "rootDir": "./",
    // "baseUrl": "./",
    "outDir": "dist/",
    "module": "ESNext",
    "moduleResolution": "node",
    "esModuleInterop": true,
    "importHelpers": true,
    "forceConsistentCasingInFileNames":true,
    "removeComments":true,
    "strict":true,
  },
  "include": ["../../.prtcls.config.js", "**/*.js"],
  // "exclude": ["dist/"]
  "exclude": ["node_modules", "lib", "tests"]
}

Is there any way to import the object that would be exported from /path/to/project/.prtcls.config.js?

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