Skip to content

Commit

Permalink
Remove obsolete checks
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jan 15, 2025
1 parent 201ee51 commit 50a777f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/knip/fixtures/class-members/members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class MyClass {
public set unusedSetter(value: string) {
console.log(value);
}

/** @public */
public set unusedTaggedSetter(value: string) {}
}

MyClass.displayName = 'My Class';
3 changes: 0 additions & 3 deletions packages/knip/src/ProjectPrincipal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,13 @@ export class ProjectPrincipal {
}

return members.filter(member => {
if (member.jsDocTags.has(PUBLIC_TAG)) return false;
const referencedSymbols = this.findReferences?.(filePath, member.pos) ?? [];
const refs = referencedSymbols.flatMap(refs => refs.references).filter(ref => !ref.isDefinition);
return refs.length === 0;
});
}

public hasExternalReferences(filePath: string, exportedItem: Export) {
if (exportedItem.jsDocTags.has(PUBLIC_TAG)) return false;

if (!this.findReferences) {
const languageService = ts.createLanguageService(this.backend.languageServiceHost, ts.createDocumentRegistry());
this.findReferences = timerify(languageService.findReferences);
Expand Down

0 comments on commit 50a777f

Please sign in to comment.