Skip to content

Commit 3ef6e64

Browse files
Merge pull request #165 from nextcloud/fix/oca-search-was-removed
fix: `OCA.Search` was removed in Nextcloud 20
2 parents 92783fa + ce553b9 commit 3ef6e64

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/rules/no-removed-apis.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ const oc_sub = {
3535
},
3636
}
3737

38+
const oca = {
39+
// ref: https://github.com/nextcloud/server/commit/6eced42b7a40f5b0ea0489244583219d0ee2e7af
40+
Search: '20.0.0',
41+
}
42+
3843
// TODO: handle OC.x.y.z like OC.Share.ShareConfigModel.areAvatarsEnabled()
3944
// ref https://github.com/nextcloud/server/issues/11045
4045

@@ -57,6 +62,12 @@ module.exports = {
5762
create: function (context) {
5863
return {
5964
MemberExpression: function (node) {
65+
// OCA.x
66+
if (node.object.name === 'OCA'
67+
&& oca.hasOwnProperty(node.property.name)) {
68+
context.report(node, "The property or function OCA." + node.property.name + " was removed in Nextcloud " + oc[node.property.name]);
69+
}
70+
6071
// OC.x
6172
if (node.object.name === 'OC'
6273
&& oc.hasOwnProperty(node.property.name)) {

0 commit comments

Comments
 (0)