Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docs: add examples for typescript.tsConfig and typescript.nodeTsConfi…#34948

Open
PasserbyPh wants to merge 3 commits intonuxt:mainnuxt/nuxt:mainfrom
PasserbyPh:docs/#34756-custom-files-typecheckingPasserbyPh/nuxt:docs/#34756-custom-files-typecheckingCopy head branch name to clipboard
Open

docs: add examples for typescript.tsConfig and typescript.nodeTsConfi…#34948
PasserbyPh wants to merge 3 commits intonuxt:mainnuxt/nuxt:mainfrom
PasserbyPh:docs/#34756-custom-files-typecheckingPasserbyPh/nuxt:docs/#34756-custom-files-typecheckingCopy head branch name to clipboard

Conversation

@PasserbyPh
Copy link
Copy Markdown

🔗 Linked issue

resolves #34756

📚 Description

Adds documentation for how to include custom files in type-checking, as requested by @danielroe in the issue.

Changes:

  • docs/4.api/6.nuxt-config.md — Added usage examples for typescript.tsConfig and typescript.nodeTsConfig, with guidance on when to use each option.

  • docs/3.guide/1.concepts/8.typescript.md — Added a new "Including Custom Files in Type-Checking" section after## Project References, explaining that files outside standard directories (e.g., tests/) are not type-checked by default and how to include them using the relevant config option, with links to the API reference.

@PasserbyPh PasserbyPh requested a review from danielroe as a code owner April 29, 2026 14:32
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Comment thread docs/3.guide/1.concepts/8.typescript.md
@coderabbitai

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/3.guide/1.concepts/8.typescript.md (1)

106-117: Minor doc improvement: link to both tsConfig and nodeTsConfig API sections (and keep punctuation consistent).

The new section explains both options, but the ::read-more currently points only to the typescript.tsConfig API docs. Consider adding a second read-more (or expanding the existing one) to also link to typescript.nodeTsConfig for completeness.

Also, the static-analysis hints flag “loose punctuation mark” around Line 114 and Line 116—worth double-checking that list-item terminal punctuation is consistent with surrounding docs styles.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/3.guide/1.concepts/8.typescript.md` around lines 106 - 117, The docs
section links only to typescript.tsConfig but should also reference
typescript.nodeTsConfig and ensure list-item punctuation matches project style;
update the read-more block (or add a second read-more) so it links to both the
tsConfig and nodeTsConfig API pages, and adjust the terminal punctuation of the
two list items that mention "Nuxt app context" and "Node context" (references to
tsConfig and nodeTsConfig) to match surrounding documentation punctuation style;
locate and change the `typescript.tsConfig` and `typescript.nodeTsConfig`
mentions in the text and the `::read-more` helper to add the second link and fix
punctuation consistency.
docs/4.api/6.nuxt-config.md (1)

1543-1558: Minor clarity: explicitly state paths/globs are resolved relative to the generated .nuxt/*.json tsconfig location.

The new tsConfig example (include: ['../tests/**/*.ts']) will likely work, but Nuxt’s generated tsconfig files live under .nuxt/ (or buildDir). If include patterns are interpreted relative to the generated tsconfig file (as TS typically does), it’s worth a 1-line note like “paths are relative to the generated tsconfig location” to prevent confusion when users change buildDir.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/4.api/6.nuxt-config.md` around lines 1543 - 1558, Add a one-line
clarification to the `tsConfig` section noting that include paths/globs (e.g.,
the example `include: ['../tests/**/*.ts']`) are resolved relative to the
generated Nuxt tsconfig files under `.nuxt/` (or the configured `buildDir`), so
users should craft patterns accordingly if they change `buildDir`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/3.guide/1.concepts/8.typescript.md`:
- Around line 106-117: The docs section links only to typescript.tsConfig but
should also reference typescript.nodeTsConfig and ensure list-item punctuation
matches project style; update the read-more block (or add a second read-more) so
it links to both the tsConfig and nodeTsConfig API pages, and adjust the
terminal punctuation of the two list items that mention "Nuxt app context" and
"Node context" (references to tsConfig and nodeTsConfig) to match surrounding
documentation punctuation style; locate and change the `typescript.tsConfig` and
`typescript.nodeTsConfig` mentions in the text and the `::read-more` helper to
add the second link and fix punctuation consistency.

In `@docs/4.api/6.nuxt-config.md`:
- Around line 1543-1558: Add a one-line clarification to the `tsConfig` section
noting that include paths/globs (e.g., the example `include:
['../tests/**/*.ts']`) are resolved relative to the generated Nuxt tsconfig
files under `.nuxt/` (or the configured `buildDir`), so users should craft
patterns accordingly if they change `buildDir`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6e6c39c4-684b-44e9-97dd-3d968f8654ad

📥 Commits

Reviewing files that changed from the base of the PR and between cadd903 and 5450a0f.

📒 Files selected for processing (2)
  • docs/3.guide/1.concepts/8.typescript.md
  • docs/4.api/6.nuxt-config.md

@github-actions github-actions Bot added 5.x 📚 documentation Documentation improvements or additions labels Apr 29, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/3.guide/1.concepts/8.typescript.md`:
- Around line 106-118: Add a short tip after the "Including Custom Files in
Type-Checking" section that links to the test-specific TypeScript docs to avoid
duplication; specifically insert a note referencing the Testing guide URL
(/docs/4.x/getting-started/testing#typescript-support-in-tests) right after the
explanation of typescript.TSConfig and typescript.nodeTsConfig (i.e., after the
Node context paragraph), with copy like "For TypeScript support specifically in
test files, see the Testing guide" so readers can follow up on test-specific
configuration without repeating content.
- Line 112: Update the docs line to reference the actual Nuxt config property
name: replace the incorrect `typescript.TSConfig` with the correct
`typescript.tsConfig` (lowercase "ts") so it matches the schema property; ensure
the sentence still points to the tsConfig entry (e.g., "Extend
`typescript.tsConfig`") and keep the example composable/import context
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b4227f97-5547-454e-988b-012147d1b0cb

📥 Commits

Reviewing files that changed from the base of the PR and between 5450a0f and 140a4eb.

📒 Files selected for processing (2)
  • docs/3.guide/1.concepts/8.typescript.md
  • docs/4.api/6.nuxt-config.md
✅ Files skipped from review due to trivial changes (1)
  • docs/4.api/6.nuxt-config.md

Comment thread docs/3.guide/1.concepts/8.typescript.md
Comment thread docs/3.guide/1.concepts/8.typescript.md Outdated
@PasserbyPh PasserbyPh force-pushed the docs/#34756-custom-files-typechecking branch from 140a4eb to 1956b32 Compare April 29, 2026 14:59
@PasserbyPh
Copy link
Copy Markdown
Author

@danielroe Hello, I've updated the PR:

  1. Removed the duplicate ::read-more link to the API reference since the bullet points in the new section already link to nuxt-config#tsconfig / #nodetsconfig directly
  2. Added a ::read-more linking to the testing docs (#typescript-support-in-tests) for test-specific examples

@PasserbyPh PasserbyPh force-pushed the docs/#34756-custom-files-typechecking branch from 1956b32 to de248c6 Compare April 30, 2026 03:39
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/3.guide/1.concepts/8.typescript.md (2)

106-117: ⚡ Quick win

Make the “how” explicit: mention include globs in tsConfig/nodeTsConfig.

Right now the section tells users what to extend, but not the mechanism (i.e. that these options are where you add include entries/globs for the custom files). Adding a short one-liner after the two bullets would reduce confusion and help readers apply the guidance without needing to immediately jump to the API docs.

Suggested patch
 - **Node context** — For files that only use plain TypeScript/Node.js APIs and do not depend on Nuxt-specific features (e.g., build scripts, configuration utilities). Extend [`typescript.nodeTsConfig`](/docs/4.x/api/nuxt-config#nodetsconfig).
 +
 + In both cases, use the option’s `include` globs (or equivalent) to pull in files outside Nuxt’s standard directories (for example, anything under `tests/`).
 
 ::read-more{to="/docs/4.x/getting-started/testing#typescript-support-in-tests"}
 For test-specific examples, see TypeScript Support in Tests.
 ::
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/3.guide/1.concepts/8.typescript.md` around lines 106 - 117, Add a
clarifying one-liner after the two bullets that explains how to include custom
files by adding include globs to the TypeScript settings (i.e., add an "include"
array/glob patterns to typescript.tsConfig for Nuxt app-context files and to
typescript.nodeTsConfig for Node-context files) so readers know these options
are where to add their custom file globs.

115-117: 💤 Low value

Minor wording/casing consistency in the read-more callout.

“TypeScript Support in Tests” is capitalised like a title. If that’s meant to be a literal doc-title match, it’s fine; otherwise consider using sentence case (“TypeScript support in tests”) to stay consistent with the surrounding text.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/3.guide/1.concepts/8.typescript.md` around lines 115 - 117, The
::read-more callout text "TypeScript Support in Tests" uses title case; update
the callout to use sentence case for consistency with surrounding text by
changing that string to "TypeScript support in tests" in the ::read-more
invocation so the display text matches the desired casing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/3.guide/1.concepts/8.typescript.md`:
- Around line 106-117: Add a clarifying one-liner after the two bullets that
explains how to include custom files by adding include globs to the TypeScript
settings (i.e., add an "include" array/glob patterns to typescript.tsConfig for
Nuxt app-context files and to typescript.nodeTsConfig for Node-context files) so
readers know these options are where to add their custom file globs.
- Around line 115-117: The ::read-more callout text "TypeScript Support in
Tests" uses title case; update the callout to use sentence case for consistency
with surrounding text by changing that string to "TypeScript support in tests"
in the ::read-more invocation so the display text matches the desired casing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c6a8f223-f816-4548-af21-f042f0f755e2

📥 Commits

Reviewing files that changed from the base of the PR and between 140a4eb and de248c6.

📒 Files selected for processing (2)
  • docs/3.guide/1.concepts/8.typescript.md
  • docs/4.api/6.nuxt-config.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/4.api/6.nuxt-config.md

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
docs/3.guide/1.concepts/8.typescript.md (2)

115-117: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Tighten the ::read-more block wording/punctuation to avoid doc lint warnings.

LanguageTool hints show “Loose punctuation mark” around the ::read-more block (near Line [116]). The current line ends with a period (“Tests.”) immediately before the directive is closed, which can trigger formatting/lint noise.

🛠️ Proposed change
 ::read-more{to="/docs/4.x/getting-started/testing#typescript-support-in-tests"}
-For test-specific examples, see TypeScript Support in Tests.
+For TypeScript support specifically in test files, see TypeScript Support in Tests.
 ::
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/3.guide/1.concepts/8.typescript.md` around lines 115 - 117, Tighten the
::read-more block punctuation by removing the trailing period inside the
directive text so it reads
::read-more{to="/docs/4.x/getting-started/testing#typescript-support-in-tests"}For
test-specific examples, see TypeScript Support in Tests::, or alternatively
place the sentence-ending period after the closing directive; update the
::read-more block (the directive targeting
"/docs/4.x/getting-started/testing#typescript-support-in-tests") accordingly to
avoid the “Loose punctuation mark” lint warning.

106-113: ⚠️ Potential issue | 🟠 Major

Fix incorrect config property name: use typescript.tsConfig (not typescript.TSConfig).

Line 112 references typescript.TSConfig (capital "TS"), but the correct Nuxt property is typescript.tsConfig (lowercase "ts"). Users copying the wrong property name will not have their custom files included in type-checking.

Fix
-  - **Nuxt app context** — For files that import from Vue, Nuxt, or use auto-imported composables (e.g., test files using `mount()` or `useNuxtApp()`). Extend [`typescript.TSConfig`](/docs/4.x/api/nuxt-config#tsconfig).
+  - **Nuxt app context** — For files that import from Vue, Nuxt, or use auto-imported composables (e.g., test files using `mount()` or `useNuxtApp()`). Extend [`typescript.tsConfig`](/docs/4.x/api/nuxt-config#tsconfig).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/3.guide/1.concepts/8.typescript.md` around lines 106 - 113, The
documentation incorrectly references the Nuxt config property as
typescript.TSConfig (capital "TS"); update the text to use the correct property
name typescript.tsConfig (lowercase "ts") wherever mentioned and ensure the
distinction versus typescript.nodeTsConfig remains clear so readers use
typescript.tsConfig for Nuxt app-context type-checking and
typescript.nodeTsConfig for Node-context files.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/3.guide/1.concepts/8.typescript.md`:
- Around line 115-117: Tighten the ::read-more block punctuation by removing the
trailing period inside the directive text so it reads
::read-more{to="/docs/4.x/getting-started/testing#typescript-support-in-tests"}For
test-specific examples, see TypeScript Support in Tests::, or alternatively
place the sentence-ending period after the closing directive; update the
::read-more block (the directive targeting
"/docs/4.x/getting-started/testing#typescript-support-in-tests") accordingly to
avoid the “Loose punctuation mark” lint warning.
- Around line 106-113: The documentation incorrectly references the Nuxt config
property as typescript.TSConfig (capital "TS"); update the text to use the
correct property name typescript.tsConfig (lowercase "ts") wherever mentioned
and ensure the distinction versus typescript.nodeTsConfig remains clear so
readers use typescript.tsConfig for Nuxt app-context type-checking and
typescript.nodeTsConfig for Node-context files.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 71df0ec7-0885-497d-bf10-7dc2befb24e8

📥 Commits

Reviewing files that changed from the base of the PR and between de248c6 and 6aa4837.

📒 Files selected for processing (1)
  • docs/3.guide/1.concepts/8.typescript.md

Comment thread docs/3.guide/1.concepts/8.typescript.md Outdated
@PasserbyPh
Copy link
Copy Markdown
Author

I have added and also restructured the API reference sections to better match the existing doc style — changed include as a sub-section to accommodate other properties that may be added to tsConfig in the future. Let me know if anything else needs adjustment.🥰

@PasserbyPh PasserbyPh requested a review from danielroe May 3, 2026 08:58
PasserbyPh and others added 3 commits May 7, 2026 22:51
- Add `<!-- @case-police-ignore tsConfig -->` to prevent auto-correction
- Fix `typescript.TSConfig` -> `typescript.tsConfig` in guide
- Restructure API reference: extract `include` as a sub-section under `### tsConfig`/`### nodeTsConfig`
@PasserbyPh PasserbyPh force-pushed the docs/#34756-custom-files-typechecking branch from 4d3af7a to 0a53787 Compare May 7, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x 📚 documentation Documentation improvements or additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests not in a test[s]/nuxt/ subdirectory are excluded from typechecking

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.