Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Check renderer declarations in sources only #394

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ export default class SourceFileLinter {
if (ts.isIdentifier(rendererMember.initializer)) {
const {symbol} = this.#checker.getTypeAtLocation(rendererMember);
const {declarations} = symbol ?? {};
declarations?.forEach((declaration) => this.analyzeControlRendererInternals(declaration));
declarations?.forEach((declaration) => {
if (declaration.getSourceFile().fileName.startsWith("/types/")) {
// Do not analyze declarations inside type definitions
return;
}
this.analyzeControlRendererInternals(declaration);
});
} else {
// Analyze renderer property when it's directly embedded in the renderer object
// i.e. { renderer: {apiVersion: "2", render: () => {}} }
Expand Down