Skip to content

Commit cfea6e1

Browse files
committed
skip all d.ts, not just node_modules/lib
1 parent 715f235 commit cfea6e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/codefixes/addOptionalPropertyUndefined.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace ts.codefix {
4848
}
4949
const { source: sourceNode, target: targetNode } = sourceTarget;
5050
const target = checker.getTypeAtLocation(targetNode);
51-
if (target.symbol?.declarations?.some(d => getSourceFileOfNode(d).fileName.match(/(node_modules|^lib\.)/))) {
51+
if (target.symbol?.declarations?.some(d => getSourceFileOfNode(d).fileName.match(/\.d\.ts$/))) {
5252
return [];
5353
}
5454
return checker.getExactOptionalUnassignableProperties(checker.getTypeAtLocation(sourceNode), target);

0 commit comments

Comments
 (0)