chore: fix lint issues

This commit is contained in:
Julien Fontanet 2022-11-24 15:45:02 +01:00
parent 92f3b4ddd7
commit 37aea1888d
18 changed files with 41 additions and 21 deletions

View File

@ -30,6 +30,7 @@ if (args.length === 0) {
${name} v${version}
`)
// eslint-disable-next-line n/no-process-exit
process.exit()
}

View File

@ -49,7 +49,6 @@ exports.FullBackupWriter = class FullBackupWriter extends MixinBackupWriter(Abst
const dataBasename = basename + '.xva'
const dataFilename = backupDir + '/' + dataBasename
const metadataFilename = `${backupDir}/${basename}.json`
const metadata = {
jobId: job.id,
mode: job.mode,

View File

@ -11,7 +11,7 @@
</template>
<script lang="ts" setup>
import AccountButton from '@/components/AccountButton.vue'
import AccountButton from "@/components/AccountButton.vue";
</script>
<style lang="postcss" scoped>

View File

@ -43,14 +43,14 @@
<template #buttons>
<UiButton transparent @click="addNewFilter">
{{ $t("add-or") }}
</UiButton>
{{ $t("add-or") }}
</UiButton>
<UiButton :disabled="!isFilterValid" type="submit">
{{ $t(editedFilter ? "update" : "add") }}
</UiButton>
<UiButton outlined @click="handleCancel">
{{ $t("cancel") }}
</UiButton>
{{ $t("cancel") }}
</UiButton>
</template>
</UiModal>
</template>

View File

@ -41,8 +41,8 @@
<template #buttons>
<UiButton type="submit">{{ $t("add") }}</UiButton>
<UiButton outlined @click="handleCancel">
{{ $t("cancel") }}
</UiButton>
{{ $t("cancel") }}
</UiButton>
</template>
</UiModal>
</template>

View File

@ -12,7 +12,7 @@
:icon="faServer"
:route="{ name: 'host.dashboard', params: { uuid: host.uuid } }"
>
{{ host.name_label || '(Host)' }}
{{ host.name_label || "(Host)" }}
<template #actions>
<InfraAction
:icon="isExpanded ? faAngleDown : faAngleUp"

View File

@ -12,7 +12,7 @@
:icon="faDisplay"
:route="{ name: 'vm.console', params: { uuid: vm.uuid } }"
>
{{ vm.name_label || '(VM)' }}
{{ vm.name_label || "(VM)" }}
<template #actions>
<InfraAction>
<PowerStateIcon :state="vm?.power_state" />

View File

@ -19,7 +19,9 @@
rel="noopener noreferrer"
href="https://xcp-ng.org/blog/"
>{{ $t("news-name", { name: "XCP-ng" }) }}</a
> - <a
>
-
<a
target="_blank"
rel="noopener noreferrer"
href="https://xen-orchestra.com/blog/"
@ -35,7 +37,9 @@
rel="noopener noreferrer"
href="https://xcp-ng.org/forum"
>{{ $t("community-name", { name: "XCP-ng" }) }}</a
> - <a
>
-
<a
target="_blank"
rel="noopener noreferrer"
href="https://xcp-ng.org/forum/category/12/xen-orchestra"

View File

@ -1,9 +1,9 @@
'use strict'
const fromCallback = require('promise-toolbox/fromCallback')
// eslint-disable-next-line n/no-missing-require
// eslint-disable-next-line n/no-extraneous-require
const splitHost = require('split-host')
// eslint-disable-next-line n/no-missing-require
// eslint-disable-next-line n/no-extraneous-require
const { createClient, Facility, Severity, Transport } = require('syslog-client')
const LEVELS = require('../levels')

View File

@ -2,7 +2,9 @@
// This file has been generated by [index-modules](https://npmjs.com/index-modules)
//
var d = Object.defineProperty
'use strict'
const d = Object.defineProperty
function de(o, n, v) {
d(o, n, { enumerable: true, value: v })
return v
@ -17,7 +19,7 @@ function dl(o, n, g, a) {
})
}
function r(p) {
var v = require(p)
const v = require(p)
return v && v.__esModule
? v
: typeof v === 'object' || typeof v === 'function'
@ -32,7 +34,7 @@ function e(p, i) {
}
d(exports, '__esModule', { value: true })
var defaults = de(exports, 'default', {})
const defaults = de(exports, 'default', {})
e('./check.js', 'check')
e('./compare.js', 'compare')
e('./copy.js', 'copy')

View File

@ -95,8 +95,6 @@ test('It rename and unlink a VHDFile', async () => {
await convertFromRawToVhd(rawFileName, vhdFileName)
await Disposable.use(async function* () {
const handler = yield getSyncedHandler({ url: 'file:///' })
const { size } = await fs.stat(vhdFileName)
const targetFileName = `${tempDir}/renamed.vhd`
await VhdAbstract.unlink(handler, vhdFileName)
expect(await fs.exists(vhdFileName)).toEqual(false)
@ -130,7 +128,6 @@ test('It create , rename and unlink alias', async () => {
const vhdFileName = `${tempDir}/randomfile.vhd`
await convertFromRawToVhd(rawFileName, vhdFileName)
const aliasFileName = `${tempDir}/aliasFileName.alias.vhd`
const aliasFileNameRenamed = `${tempDir}/aliasFileNameRenamed.alias.vhd`
await Disposable.use(async function* () {
const handler = yield getSyncedHandler({ url: 'file:///' })

View File

@ -0,0 +1,5 @@
'use strict'
module.exports = {
ignorePatterns: ['*'],
}

View File

@ -55,3 +55,4 @@ setTimeout(function () {
name: 'Steve',
})
}, 10)
/* eslint-enable no-console */

View File

@ -1,3 +1,5 @@
/* eslint-disable no-console */
'use strict'
process.on('unhandledRejection', function (error) {
@ -59,3 +61,5 @@ xo.open()
.then(function () {
return xo.close()
})
/* eslint-enable no-console */

View File

@ -1,3 +1,5 @@
/* eslint-disable no-console */
'use strict'
// This is one of the simplest xo-server's plugin than can be created.
@ -78,3 +80,5 @@ exports.default = function (opts) {
},
}
}
/* eslint-enable no-console */

View File

@ -6,6 +6,7 @@ function handleHook(type, data) {
const hooks = this._hooks[data.method]?.[type]
if (hooks !== undefined) {
return Promise.all(
// eslint-disable-next-line array-callback-return
hooks.map(({ url, waitForResponse = false }) => {
const promise = this._makeRequest(url, type, data).catch(error => {
log.error('web hook failed', {

View File

@ -57,8 +57,10 @@ export async function copyVm({ vm, sr }) {
// full
{
// eslint-disable-next-line no-console
console.log('export full VM...')
const input = await srcXapi.VM_export(vm._xapiRef)
// eslint-disable-next-line no-console
console.log('import full VM...')
await tgtXapi.VM_destroy((await tgtXapi.importVm(input, { srId: sr })).$ref)
}

View File

@ -38,7 +38,7 @@ export async function writeOvaOn(
}
disk.fileSize = size
return new Promise((resolve, reject) => {
const entry = pack.entry({ name: `${disk.name}.vmdk`, size: size }, err => {
const entry = pack.entry({ name: `${disk.name}.vmdk`, size }, err => {
if (err == null) {
return resolve()
} else return reject(err)