Skip to content

Commit

Permalink
feat(TSFileDetector): Add ui5.yaml detection & linting
Browse files Browse the repository at this point in the history
  • Loading branch information
maxreichmann committed Apr 10, 2024
1 parent 9c5ef4f commit 3e9a992
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/detectors/typeChecker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ export class TsFileDetector extends FileBasedDetector {
transformationResult = await lintHtml(path.basename(filePath), fs.createReadStream(filePath));
// transformationResult.source = fileContent;
transformationResult.source = "";
} else if (filePath.endsWith(".yaml")) {
const fileContent = ts.sys.readFile(filePath);
if (!fileContent) {
throw new Error(`Failed to read file ${filePath}`);
}
internalfilePath = internalfilePath.replace(/\.yaml$/, ".js");
transformationResult = await lintUI5Yaml(filePath.replace(/\.yaml$/, ".js"), fileContent);
transformationResult.source = "";
} else {
throw new Error(`Unsupported file type for ${filePath}`);
}
Expand Down

0 comments on commit 3e9a992

Please sign in to comment.