Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: OCA.Search was removed in Nextcloud 20 #165

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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