Skip to content

Commit

Permalink
fix: Add Fragment creation check
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Feb 10, 2025
1 parent 958c3e3 commit ce27fdd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export default class SourceFileLinter {
return [
"sap/ui/core/mvc/View",
"sap/ui/core/mvc/XMLView",
"sap/ui/core/Fragment",
].includes((potentialImport?.moduleSpecifier as ts.StringLiteral)?.text);
}

Expand Down
13 changes: 11 additions & 2 deletions test/lib/linter/rules/snapshots/XMLInJs.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ Generated by [AVA](https://avajs.dev).
[
{
coverageInfo: [],
errorCount: 0,
errorCount: 1,
fatalErrorCount: 0,
filePath: 'FragmentLoad.js',
messages: [],
messages: [
{
column: 12,
line: 7,
message: 'Use of deprecated property \'tap\' of class \'Button\'',
messageDetails: 'Deprecated test message',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]
Expand Down
Binary file modified test/lib/linter/rules/snapshots/XMLInJs.ts.snap
Binary file not shown.

0 comments on commit ce27fdd

Please sign in to comment.