Skip to content

Commit

Permalink
Merge pull request #165 from nextcloud/fix/oca-search-was-removed
Browse files Browse the repository at this point in the history
fix: `OCA.Search` was removed in Nextcloud 20
  • Loading branch information
ChristophWurst authored Jul 6, 2023
2 parents 92783fa + ce553b9 commit 3ef6e64
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/rules/no-removed-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const oc_sub = {
},
}

const oca = {
// ref: https://github.com/nextcloud/server/commit/6eced42b7a40f5b0ea0489244583219d0ee2e7af
Search: '20.0.0',
}

// TODO: handle OC.x.y.z like OC.Share.ShareConfigModel.areAvatarsEnabled()
// ref https://github.com/nextcloud/server/issues/11045

Expand All @@ -57,6 +62,12 @@ module.exports = {
create: function (context) {
return {
MemberExpression: function (node) {
// OCA.x
if (node.object.name === 'OCA'
&& oca.hasOwnProperty(node.property.name)) {
context.report(node, "The property or function OCA." + node.property.name + " was removed in Nextcloud " + oc[node.property.name]);
}

// OC.x
if (node.object.name === 'OC'
&& oc.hasOwnProperty(node.property.name)) {
Expand Down

0 comments on commit 3ef6e64

Please sign in to comment.