Skip to content

Commit

Permalink
fix: False positive for deprecated JS view/fragment type
Browse files Browse the repository at this point in the history
The *.view.js / *.fragment.js file naming is just a convention but does
not imply the usage of deprecated view/fragment API.
As JS/TS files are checked already and usages of sap.ui.jsview /
sap.ui.jsfragment are reported, there is no need to implement a separate
check.
  • Loading branch information
matz3 committed Oct 17, 2024
1 parent 9cc1202 commit 8f2fe1f
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 96 deletions.
4 changes: 0 additions & 4 deletions src/linter/fileTypes/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import {MESSAGE} from "../messages.js";
const deprecatedViewFileTypes = [
".view.json",
".view.html",
".view.js",
".view.tmpl",
".view.ts",
".fragment.html",
".fragment.js",
".fragment.ts",
];

export default async function lintFileTypes({filePathsWorkspace, context}: LinterParameters) {
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
92 changes: 0 additions & 92 deletions test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1190,52 +1190,6 @@ Generated by [AVA](https://avajs.dev).
},
]

## General: NoDeprecatedFileType.fragment.js

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'NoDeprecatedFileType.fragment.js',
messages: [
{
column: undefined,
line: undefined,
message: 'Use of deprecated view type \'JS\'. Use \'XML\' instead\'',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]

## General: NoDeprecatedFileType.fragment.ts

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'NoDeprecatedFileType.fragment.ts',
messages: [
{
column: undefined,
line: undefined,
message: 'Use of deprecated view type \'TS\'. Use \'XML\' instead\'',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]

## General: NoDeprecatedFileType.view.html

> Snapshot 1
Expand All @@ -1259,29 +1213,6 @@ Generated by [AVA](https://avajs.dev).
},
]

## General: NoDeprecatedFileType.view.js

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'NoDeprecatedFileType.view.js',
messages: [
{
column: undefined,
line: undefined,
message: 'Use of deprecated view type \'JS\'. Use \'XML\' instead\'',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]

## General: NoDeprecatedFileType.view.json

> Snapshot 1
Expand All @@ -1305,29 +1236,6 @@ Generated by [AVA](https://avajs.dev).
},
]

## General: NoDeprecatedFileType.view.ts

> Snapshot 1
[
{
coverageInfo: [],
errorCount: 1,
fatalErrorCount: 0,
filePath: 'NoDeprecatedFileType.view.ts',
messages: [
{
column: undefined,
line: undefined,
message: 'Use of deprecated view type \'TS\'. Use \'XML\' instead\'',
ruleId: 'no-deprecated-api',
severity: 2,
},
],
warningCount: 0,
},
]

## General: PartialDeprecation.js

> Snapshot 1
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.

0 comments on commit 8f2fe1f

Please sign in to comment.