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

203
Views
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
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!