Skip to content

Commit

Permalink
fix: Add messageDetails for Lib.init apiVersion check
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Mar 25, 2024
1 parent e5925c0 commit 0bb711f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/detectors/typeChecker/FileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export default class FileLinter {
ruleId: "ui5-linter-no-partially-deprecated-api",
message:
`Call to ${importedVarName}() must be declared with property {apiVersion: 2}`,
messageDetails: this.#messageDetails ? `{@link sap.ui.core.Lib.init Lib.init}` : undefined,
});
}
}
Expand Down
11 changes: 11 additions & 0 deletions test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 9,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -812,6 +813,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 10,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -820,6 +822,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 11,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -828,6 +831,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 12,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -836,6 +840,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 16,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -844,6 +849,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 19,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -852,6 +858,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 22,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -860,6 +867,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 25,
message: 'Call to Library.init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -868,6 +876,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 30,
message: 'Call to LibInit() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -876,6 +885,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 35,
message: 'Call to init() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand All @@ -884,6 +894,7 @@ Generated by [AVA](https://avajs.dev).
fatal: undefined,
line: 40,
message: 'Call to intRenames() must be declared with property {apiVersion: 2}',
messageDetails: 'Lib.init (https://ui5.sap.com/1.120/#/api/sap.ui.core.Lib)',
ruleId: 'ui5-linter-no-partially-deprecated-api',
severity: 2,
},
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.

0 comments on commit 0bb711f

Please sign in to comment.