Skip to content

Commit f14959f

Browse files
committed
fix some eslint warnings
Signed-off-by: Julien Veyssier <[email protected]>
1 parent af4ebe0 commit f14959f

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

.eslintrc.cjs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
16
module.exports = {
2-
extends: [
3-
'@nextcloud',
4-
],
57
globals: {
6-
__webpack_nonce__: 'writable',
7-
__webpack_public_path__: 'writable',
8+
appVersion: true
9+
},
10+
parserOptions: {
11+
requireConfigFile: false
812
},
13+
extends: [
14+
'@nextcloud'
15+
],
16+
rules: {
17+
'jsdoc/require-jsdoc': 'off',
18+
'jsdoc/tag-lines': 'off',
19+
'vue/first-attribute-linebreak': 'off',
20+
'import/extensions': 'off',
21+
'import/no-unresolved': ['error', { 'ignore': ["\\?raw"] }],
22+
'vue/no-v-model-argument': 'off',
23+
'vue/no-v-html': 'off',
24+
'jsdoc/require-param-type': 'off',
25+
'jsdoc/require-param-description': 'off',
26+
}
927
}

src/admin-settings.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Handles events and dynamic updates for server-rendered HTML
66
*/
77

8+
import { generateUrl } from '@nextcloud/router'
9+
810
(function() {
911
'use strict'
1012

@@ -152,7 +154,7 @@
152154
*
153155
*/
154156
function loadConnectedUsersCount() {
155-
fetch(OC.generateUrl('/apps/integration_itop/admin-config'), {
157+
fetch(generateUrl('/apps/integration_itop/admin-config'), {
156158
method: 'GET',
157159
headers: {
158160
requesttoken: OC.requestToken,
@@ -221,7 +223,7 @@
221223
requestData.values.application_token = token
222224
}
223225

224-
fetch(OC.generateUrl('/apps/integration_itop/admin-config'), {
226+
fetch(generateUrl('/apps/integration_itop/admin-config'), {
225227
method: 'PUT',
226228
headers: {
227229
'Content-Type': 'application/json',
@@ -303,7 +305,7 @@
303305
statusElement.textContent = textTesting
304306
if (statusCard) statusCard.className = 'status-card connection-status testing'
305307

306-
fetch(OC.generateUrl('/apps/integration_itop/admin-config/test'), {
308+
fetch(generateUrl('/apps/integration_itop/admin-config/test'), {
307309
method: 'POST',
308310
headers: {
309311
'Content-Type': 'application/json',
@@ -356,7 +358,7 @@
356358
const originalText = testButton.innerHTML
357359
testButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Testing...')
358360

359-
fetch(OC.generateUrl('/apps/integration_itop/admin-config/test-token'), {
361+
fetch(generateUrl('/apps/integration_itop/admin-config/test-token'), {
360362
method: 'POST',
361363
headers: {
362364
'Content-Type': 'application/json',
@@ -399,7 +401,7 @@
399401
const originalText = saveButton.innerHTML
400402
saveButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Saving...')
401403

402-
fetch(OC.generateUrl('/apps/integration_itop/admin-config'), {
404+
fetch(generateUrl('/apps/integration_itop/admin-config'), {
403405
method: 'PUT',
404406
headers: {
405407
'Content-Type': 'application/json',
@@ -437,7 +439,7 @@
437439
const originalText = clearButton.innerHTML
438440
clearButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Clearing...')
439441

440-
fetch(OC.generateUrl('/apps/integration_itop/clear-cache'), {
442+
fetch(generateUrl('/apps/integration_itop/clear-cache'), {
441443
method: 'DELETE',
442444
headers: {
443445
requesttoken: OC.requestToken,
@@ -477,7 +479,7 @@
477479
const originalText = saveButton.innerHTML
478480
saveButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Saving...')
479481

480-
fetch(OC.generateUrl('/apps/integration_itop/admin-config'), {
482+
fetch(generateUrl('/apps/integration_itop/admin-config'), {
481483
method: 'PUT',
482484
headers: {
483485
'Content-Type': 'application/json',
@@ -544,7 +546,7 @@
544546
*/
545547
function checkAppVersion(currentVersion) {
546548

547-
fetch(OC.generateUrl('/apps/integration_itop/version-check'), {
549+
fetch(generateUrl('/apps/integration_itop/version-check'), {
548550
method: 'GET',
549551
headers: {
550552
requesttoken: OC.requestToken,

src/personal-settings.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Personal settings JavaScript
55
*/
66

7+
import { generateUrl } from '@nextcloud/router'
8+
79
(function() {
810
'use strict'
911

@@ -47,7 +49,7 @@
4749
return
4850
}
4951

50-
fetch(OC.generateUrl('/apps/integration_itop/user-info'), {
52+
fetch(generateUrl('/apps/integration_itop/user-info'), {
5153
method: 'GET',
5254
headers: {
5355
requesttoken: OC.requestToken,
@@ -127,7 +129,7 @@
127129

128130
ticketsValue.textContent = 'Loading...'
129131

130-
fetch(OC.generateUrl('/apps/integration_itop/tickets/count'), {
132+
fetch(generateUrl('/apps/integration_itop/tickets/count'), {
131133
method: 'GET',
132134
headers: {
133135
requesttoken: OC.requestToken,
@@ -258,7 +260,7 @@
258260
}
259261

260262
const req = new XMLHttpRequest()
261-
req.open('PUT', OC.generateUrl('/apps/integration_itop/config'))
263+
req.open('PUT', generateUrl('/apps/integration_itop/config'))
262264
req.setRequestHeader('requesttoken', OC.requestToken)
263265
req.setRequestHeader('Content-Type', 'application/json')
264266

0 commit comments

Comments
 (0)