Skip to content

Commit

Permalink
refactor: Naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Oct 29, 2024
1 parent 540614f commit 9c160ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class SourceFileLinter {
reporter: this.#reporter,
context: this.#context,
checker: this.#checker,
isUIComponent: this.isUi5ClassDeclaration(node, "sap/ui/core/UIComponent"),
isUiComponent: this.isUi5ClassDeclaration(node, "sap/ui/core/UIComponent"),
});
} else if (
ts.isPropertyDeclaration(node) &&
Expand Down
18 changes: 9 additions & 9 deletions src/linter/ui5Types/asyncComponentFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function analyzeComponentJson({
reporter,
context,
checker,
isUIComponent,
isUiComponent,
}: {
classDeclaration: ts.ClassDeclaration;
manifestContent: string | undefined;
Expand All @@ -45,18 +45,18 @@ export default function analyzeComponentJson({
checker: ts.TypeChecker;

// Indication whether the class not only inherits from sap/ui/core/Component but also from sap/ui/core/UIComponent
isUIComponent: boolean;
isUiComponent: boolean;
}) {
// FIXME: This does a lot more than needed when we only check a Component (not a UIComponent)
// but it requires some refactoring to only perform the "hasManifestDefinition" check in that case
const analysisResult = findAsyncInterface({
classDeclaration, manifestContent, checker, isUIComponent,
classDeclaration, manifestContent, checker, isUiComponent,
});

if (analysisResult) {
reportComponentResults({analysisResult, reporter, classDeclaration, manifestContent});
if (isUIComponent) {
reportUIComponentResults(
if (isUiComponent) {
reportUiComponentResults(
{analysisResult, context, reporter, resourcePath, classDeclaration, manifestContent}
);
}
Expand All @@ -78,11 +78,11 @@ function mergeAsyncFlags(a: AsyncFlags, b: AsyncFlags): AsyncFlags {
/**
* Search for the async interface in the class hierarchy
*/
function findAsyncInterface({classDeclaration, manifestContent, checker, isUIComponent}: {
function findAsyncInterface({classDeclaration, manifestContent, checker, isUiComponent}: {
classDeclaration: ts.ClassDeclaration;
manifestContent: string | undefined;
checker: ts.TypeChecker;
isUIComponent: boolean;
isUiComponent: boolean;
}): AsyncFlags | undefined {
const returnTypeTemplate = {
hasAsyncInterface: false,
Expand Down Expand Up @@ -112,7 +112,7 @@ function findAsyncInterface({classDeclaration, manifestContent, checker, isUICom
// We are unable to dynamically search for a parent-component's manifest.json
manifestContent: undefined,
checker,
isUIComponent,
isUiComponent,
}) ?? result;
} else if (ts.isInterfaceDeclaration(declaration)) {
result.hasAsyncInterface = doAsyncInterfaceChecks(parentClass) ?? result.hasAsyncInterface;
Expand Down Expand Up @@ -334,7 +334,7 @@ function reportComponentResults({
}
}

function reportUIComponentResults({
function reportUiComponentResults({
analysisResult, reporter, classDeclaration, manifestContent, resourcePath, context,
}: {
analysisResult: AsyncFlags;
Expand Down

0 comments on commit 9c160ae

Please sign in to comment.