Skip to content

fix: Include extended compiler options in tsconfig#6726

Merged
marikaner merged 9 commits into
mainfrom
tconfig-extension
Jul 3, 2026
Merged

fix: Include extended compiler options in tsconfig#6726
marikaner merged 9 commits into
mainfrom
tconfig-extension

Conversation

@marikaner

@marikaner marikaner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This was hardcoded and I am quite sure this was a bug in our generator.

@marikaner marikaner changed the title feat: Include extended compiler options in tsconfig fix: Include extended compiler options in tsconfig Jul 3, 2026
Comment thread .changeset/modern-cycles-learn.md Outdated
Comment thread .changeset/modern-cycles-learn.md Outdated
@marikaner marikaner marked this pull request as ready for review July 3, 2026 09:14
@marikaner marikaner requested a review from davidkna-sap July 3, 2026 09:35
…ig-extension

# Conflicts:
#	pnpm-lock.yaml
davidkna-sap
davidkna-sap previously approved these changes Jul 3, 2026

@davidkna-sap davidkna-sap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but consider using something like this instead:

import { readConfigFile, parseJsonConfigFileContent, sys } from 'typescript';

function readCompilerOptions(pathToTsConfig: string): CompilerOptions {
  const fullPath = parse(pathToTsConfig).ext === '.json'
    ? pathToTsConfig
    : resolve(pathToTsConfig, 'tsconfig.json');

  const { config, error } = readConfigFile(fullPath, sys.readFile);
  if (error) throw new Error(/* format diagnostic */);

  const result = parseJsonConfigFileContent(config, sys, parse(fullPath).dir);
  return result.options;  // already fully resolved, numeric enums, extends resolved
}```

@marikaner

Copy link
Copy Markdown
Contributor Author

LGTM, but consider using something like this instead:

import { readConfigFile, parseJsonConfigFileContent, sys } from 'typescript';

function readCompilerOptions(pathToTsConfig: string): CompilerOptions {
  const fullPath = parse(pathToTsConfig).ext === '.json'
    ? pathToTsConfig
    : resolve(pathToTsConfig, 'tsconfig.json');

  const { config, error } = readConfigFile(fullPath, sys.readFile);
  if (error) throw new Error(/* format diagnostic */);

  const result = parseJsonConfigFileContent(config, sys, parse(fullPath).dir);
  return result.options;  // already fully resolved, numeric enums, extends resolved
}```

good idea. I will try it on a follow up pr.

@marikaner marikaner merged commit 82a6d2d into main Jul 3, 2026
17 checks passed
@marikaner marikaner deleted the tconfig-extension branch July 3, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants