Skip to content

Commit

Permalink
fix: Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Jun 3, 2024
1 parent 6197af6 commit 6c7dbb4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import path from "node:path/posix";
import SourceFileReporter from "./SourceFileReporter.js";
import LinterContext, {ResourcePath, CoverageCategory, LintMessageSeverity} from "../LinterContext.js";
import {RULES, MESSAGES, formatMessage} from "../linterReporting.js";
import fs from "node:fs/promises";
import analyzeComponentJson from "./asyncComponentFlags.js";

interface DeprecationInfo {
Expand All @@ -28,8 +27,8 @@ export default class SourceFileLinter {
constructor(
context: LinterContext, resourcePath: ResourcePath,
sourceFile: ts.SourceFile, sourceMap: string | undefined, checker: ts.TypeChecker,
reportCoverage: boolean | undefined = false, messageDetails: boolean | undefined = false, manifestContent?: string | undefined,
dataTypes: Record<string, string> | undefined
reportCoverage: boolean | undefined = false, messageDetails: boolean | undefined = false,
dataTypes: Record<string, string> | undefined, manifestContent?: string | undefined
) {
this.#resourcePath = resourcePath;
this.#sourceFile = sourceFile;
Expand Down
5 changes: 3 additions & 2 deletions test/lib/linter/_linterHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ export async function esmockDeprecationText() {
sourceMap: string | undefined, checker: TypeChecker,
reportCoverage: boolean | undefined = false,
messageDetails: boolean | undefined = false,
dataTypes: Record<string, string>,
dataTypes: Record<string, string>,
manifestContent?: string | undefined
) {
// Don't use sinon's stubs as it's hard to clean after them in this case and it leaks memory.
const linter = new SourceFileLinter(
context, filePath, sourceFile, sourceMap, checker, reportCoverage, messageDetails, dataTypes, manifestContent
context, filePath, sourceFile, sourceMap, checker, reportCoverage,
messageDetails, dataTypes, manifestContent
);
linter.getDeprecationText = () => "Deprecated test message";
return linter;
Expand Down
18 changes: 9 additions & 9 deletions test/lib/linter/rules/snapshots/AsyncComponentFlags.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 6,
message: 'Component Root View and Routing are not configured to load their modules asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand Down Expand Up @@ -237,7 +237,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 6,
message: 'Component Root View and Routing are not configured to load their modules asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand Down Expand Up @@ -339,7 +339,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 7,
message: 'Component does not specify that it uses the descriptor via the manifest.json file',
messageDetails: 'A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/1.120/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).',
messageDetails: 'A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).',
ruleId: 'ui5-linter-async-component-flags',
severity: 1,
},
Expand All @@ -364,7 +364,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 6,
message: 'Component Root View is not configured to load its views asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand All @@ -389,7 +389,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 6,
message: 'Component Routing is not configured to load its targets asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/routing/config" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flag for "sap.ui5/routing/config" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand All @@ -414,7 +414,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 6,
message: 'Component Root View and Routing are not configured to load their modules asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand All @@ -439,7 +439,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 5,
message: 'Component Root View and Routing are not configured to load their modules asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.js or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand All @@ -464,7 +464,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 5,
message: 'Component does not specify that it uses the descriptor via the manifest.json file',
messageDetails: 'A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/1.120/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).',
messageDetails: 'A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).',
ruleId: 'ui5-linter-async-component-flags',
severity: 1,
},
Expand All @@ -473,7 +473,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 5,
message: 'Component Root View and Routing are not configured to load their modules asynchronously.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/1.120/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.ts or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
messageDetails: 'Use Asynchronous Loading (https://ui5.sap.com/#/topic/676b636446c94eada183b1218a824717). Implement sap.ui.core.IAsyncContentCreation interface in Component.ts or set the "async" flags for "sap.ui5/routing/config" and "sap.ui5/rootView" in the component manifest.',
ruleId: 'ui5-linter-async-component-flags',
severity: 2,
},
Expand Down
Binary file modified test/lib/linter/rules/snapshots/AsyncComponentFlags.ts.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Generated by [AVA](https://avajs.dev).
column: 1,
line: 6,
message: 'Usage of native HTML in XML Views/Fragments is deprecated',
messageDetails: 'Using Native HTML in XML Views (deprecated) (https://ui5.sap.com/1.120/#/topic/be54950cae1041f59d4aa97a6bade2d8)',
messageDetails: 'Using Native HTML in XML Views (deprecated) (https://ui5.sap.com/#/topic/be54950cae1041f59d4aa97a6bade2d8)',

Check warning on line 411 in test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md

View check run for this annotation

In Solidarity / Inclusive Language

Match Found

You might want to consider an alternative to the term "Native". Possibilities might include: "built-in", "fundamental", "ingrained", "intrinsic", "original". (This check uses pattern-matching and may therefore be incorrect. To improve the patterns or to make other suggestions, please open an issue or pull-request at https://github.com/ietf/terminology/issues.)
Raw output
/\bnative\w*\b/gi
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion test/lib/linter/xmlTemplate/snapshots/transpiler.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Generated by [AVA](https://avajs.dev).
column: 1,
line: 6,
message: 'Usage of native HTML in XML Views/Fragments is deprecated',
messageDetails: 'Using Native HTML in XML Views (deprecated) (https://ui5.sap.com/1.120/#/topic/be54950cae1041f59d4aa97a6bade2d8)',
messageDetails: 'Using Native HTML in XML Views (deprecated) (https://ui5.sap.com/#/topic/be54950cae1041f59d4aa97a6bade2d8)',

Check warning on line 704 in test/lib/linter/xmlTemplate/snapshots/transpiler.ts.md

View check run for this annotation

In Solidarity / Inclusive Language

Match Found

You might want to consider an alternative to the term "Native". Possibilities might include: "built-in", "fundamental", "ingrained", "intrinsic", "original". (This check uses pattern-matching and may therefore be incorrect. To improve the patterns or to make other suggestions, please open an issue or pull-request at https://github.com/ietf/terminology/issues.)
Raw output
/\bnative\w*\b/gi
ruleId: 'ui5-linter-no-deprecated-api',
severity: 2,
},
Expand Down
Binary file modified test/lib/linter/xmlTemplate/snapshots/transpiler.ts.snap
Binary file not shown.

0 comments on commit 6c7dbb4

Please sign in to comment.