File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ ### Bug Fixes
4+
5+ - The ` suppressCommentWarningsInDeclarationFiles ` option now correctly ignores warnings in ` .d.cts ` and ` .d.mts ` files, #2647 .
6+
37## v0.26.5 (2024-07-21)
48
59### Features
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import type {
1818} from "../../internationalization/internationalization" ;
1919import { FileRegistry } from "../../models/FileRegistry" ;
2020import { textContent , TextParserReentryState } from "./textParser" ;
21+ import { hasDeclarationFileExtension } from "../../utils/fs" ;
2122
2223interface LookaheadGenerator < T > {
2324 done ( ) : boolean ;
@@ -111,7 +112,7 @@ export function parseComment(
111112 function warningImpl ( message : TranslatedString , token : Token ) {
112113 if (
113114 config . suppressCommentWarningsInDeclarationFiles &&
114- file . fileName . endsWith ( ".d.ts" )
115+ hasDeclarationFileExtension ( file . fileName )
115116 ) {
116117 return ;
117118 }
Original file line number Diff line number Diff line change @@ -271,6 +271,10 @@ export function hasTsExtension(path: string): boolean {
271271 return / \. [ c m ] ? t s $ | \. t s x $ / . test ( path ) ;
272272}
273273
274+ export function hasDeclarationFileExtension ( path : string ) {
275+ return / \. d \. [ c m ] ? t s $ / . test ( path ) ;
276+ }
277+
274278export function discoverInParentDir < T extends { } > (
275279 name : string ,
276280 dir : string ,
You can’t perform that action at this time.
0 commit comments