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

204
Visualizações
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 à 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