Skip to content

Add types to tsconfig.json - #945

Merged
remcohaszing merged 1 commit into
remarkjs:mainfrom
zirkelc:tsconfig-types
Sep 24, 2026
Merged

remcohaszing merged 1 commit into
remarkjs:mainfrom
zirkelc:tsconfig-types

Conversation

@zirkelc

@zirkelc zirkelc commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

This adds "types": ["node"] to compilerOptions, so TypeScript only loads @types/node instead of every package in node_modules/@types of all parent folders.
In the micromark canary, repos are checked out inside the micromark tree, whose linter now installs @types/katex, and repos without the dom lib fail with ../../../node_modules/@types/katex/index.d.ts(142,46): error TS2304: Cannot find name 'HTMLElement'.
This repo includes the dom lib so it still passes, but in micromark/micromark#240 the maintainer asked for an explicit types field in all canary repos.
TypeScript 6 changes the default of types to [], so an explicit list is needed there anyway.
node is the only entry needed: the tests and scripts import node: modules, which without it only type check because @types/node is pulled in by references in other type packages.
I checked that npm test passes, and that the canary setup passes before and after this change.

@github-actions github-actions Bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Sep 24, 2026
@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a758d3c) to head (0a27a8e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #945   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines         1787      1787           
  Branches       123       123           
=========================================
  Hits          1787      1787           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@remcohaszing remcohaszing 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.

Thanks!

@remcohaszing
remcohaszing merged commit 5088035 into remarkjs:main Sep 24, 2026
5 checks passed
@github-actions

This comment has been minimized.

@remcohaszing remcohaszing added 🏡 area/internal This affects the hidden internals 💪 phase/solved Post is done 🦋 type/enhancement This is great to have and removed 🤞 phase/open Post is being triaged manually labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏡 area/internal This affects the hidden internals 💪 phase/solved Post is done 🦋 type/enhancement This is great to have

Development

Successfully merging this pull request may close these issues.

2 participants