diff --git a/cypress/.eslintrc.js b/cypress/.eslintrc.js index d940c5bac..7be192c90 100644 --- a/cypress/.eslintrc.js +++ b/cypress/.eslintrc.js @@ -8,4 +8,4 @@ module.exports = { extends: [ 'plugin:cypress/recommended', ], -}; +} diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts index d6209666f..af1d4b428 100644 --- a/cypress/dockerNode.ts +++ b/cypress/dockerNode.ts @@ -19,39 +19,44 @@ * along with this program. If not, see . * */ +/* eslint-disable no-console */ +import type { Stream } from 'stream' +import type { Container } from 'dockerode' import Docker from 'dockerode' -import waitOn from 'wait-on' import path from 'path' +import waitOn from 'wait-on' -export const docker = new Docker() +import pkg from '../package.json' -const pkg = require('../package.json'); const APP_PATH = path.resolve(__dirname, '../') const APP_NAME = pkg.name const CONTAINER_NAME = 'nextcloud-cypress-tests-' + APP_NAME const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server' +export const docker = new Docker() + /** * Start the testing container + * + * @param branch the current git branch */ -export const startNextcloud = async function (branch: string = 'master'): Promise { +export const startNextcloud = async function(branch = 'master'): Promise { try { // Pulling images console.log('Pulling images... ⏳') - await new Promise((resolve, reject): any => docker.pull(SERVER_IMAGE, (err, stream) => { - // https://github.com/apocas/dockerode/issues/357 - docker.modem.followProgress(stream, onFinished) - function onFinished(err, output) { + await new Promise((resolve, reject) => docker.pull(SERVER_IMAGE, (_err, stream: Stream) => { + const onFinished = function(err: Error | null) { if (!err) { - resolve(true) - return + return resolve(true) } reject(err) } + // https://github.com/apocas/dockerode/issues/357 + docker.modem.followProgress(stream, onFinished) })) - console.log(`└─ Done`) + console.log('└─ Done') // Getting latest image console.log('\nChecking running containers... 🔍') @@ -62,22 +67,22 @@ export const startNextcloud = async function (branch: string = 'master'): Promis const oldContainer = docker.getContainer(CONTAINER_NAME) const oldContainerData = await oldContainer.inspect() if (oldContainerData.State.Running) { - console.log(`├─ Existing running container found`) + console.log('├─ Existing running container found') if (localImage[0].Id !== oldContainerData.Image) { - console.log(`└─ But running container is outdated, replacing...`) + console.log('└─ But running container is outdated, replacing...') } else { // Get container's IP - console.log(`├─ Reusing that container`) - let ip = await getContainerIP(oldContainer) + console.log('├─ Reusing that container') + const ip = await getContainerIP(oldContainer) return ip } } else { - console.log(`└─ None found!`) + console.log('└─ None found!') } // Forcing any remnants to be removed just in case await oldContainer.remove({ force: true }) } catch (error) { - console.log(`└─ None found!`) + console.log('└─ None found!') } // Starting container @@ -92,17 +97,17 @@ export const startNextcloud = async function (branch: string = 'master'): Promis }, Env: [ `BRANCH=${branch}`, - ] + ], }) await container.start() // Get container's IP - let ip = await getContainerIP(container) + const ip = await getContainerIP(container) console.log(`├─ Nextcloud container's IP is ${ip} 🌏`) return ip } catch (err) { - console.log(`└─ Unable to start the container 🛑`) + console.log('└─ Unable to start the container 🛑') console.log(err) stopNextcloud() throw new Error('Unable to start the container') @@ -112,7 +117,7 @@ export const startNextcloud = async function (branch: string = 'master'): Promis /** * Configure Nextcloud */ -export const configureNextcloud = async function () { +export const configureNextcloud = async function() { console.log('\nConfiguring nextcloud...') const container = docker.getContainer(CONTAINER_NAME) await runExec(container, ['php', 'occ', '--version'], true) @@ -132,9 +137,9 @@ export const configureNextcloud = async function () { } /** - * Force stop the testing container + * Force stop the testing nextcloud container */ -export const stopNextcloud = async function () { +export const stopNextcloud = async function() { try { const container = docker.getContainer(CONTAINER_NAME) console.log('Stopping Nextcloud container...') @@ -146,17 +151,19 @@ export const stopNextcloud = async function () { } /** - * Get the testing container's IP + * Get the testing container's IP address + * + * @param container the container to get the ip from */ -export const getContainerIP = async function ( - container = docker.getContainer(CONTAINER_NAME) +export const getContainerIP = async function( + container: Container = docker.getContainer(CONTAINER_NAME) ): Promise { let ip = '' let tries = 0 while (ip === '' && tries < 10) { tries++ - await container.inspect(function (err, data) { + await container.inspect(function(_err, data) { ip = data?.NetworkSettings?.IPAddress || '' }) @@ -170,21 +177,25 @@ export const getContainerIP = async function ( return ip } -// Would be simpler to start the container from cypress.config.ts, -// but when checking out different branches, it can take a few seconds -// Until we can properly configure the baseUrl retry intervals, -// We need to make sure the server is already running before cypress -// https://github.com/cypress-io/cypress/issues/22676 -export const waitOnNextcloud = async function (ip: string) { +/** + * Would be simpler to start the container from cypress.config.ts, + * but when checking out different branches, it can take a few seconds + * Until we can properly configure the baseUrl retry intervals, + * We need to make sure the server is already running before cypress + * + * @param {string} ip the ip to wait for + * @see https://github.com/cypress-io/cypress/issues/22676 + */ +export const waitOnNextcloud = async function(ip: string) { console.log('├─ Waiting for Nextcloud to be ready... ⏳') await waitOn({ resources: [`http://${ip}/index.php`] }) console.log('└─ Done') } -const runExec = async function ( +const runExec = async function( container: Docker.Container, command: string[], - verbose: boolean = false + verbose = false ) { const exec = await container.exec({ Cmd: command, @@ -193,8 +204,8 @@ const runExec = async function ( User: 'www-data', }) - return new Promise((resolve, reject) => { - exec.start({}, (err, stream) => { + return new Promise((resolve) => { + exec.start({}, (_err, stream) => { if (stream) { stream.setEncoding('utf-8') stream.on('data', str => { @@ -208,6 +219,6 @@ const runExec = async function ( }) } -const sleep = function (milliseconds: number) { +const sleep = function(milliseconds: number) { return new Promise((resolve) => setTimeout(resolve, milliseconds)) } diff --git a/cypress/e2e/images/images-custom-list-loadmore.cy.js b/cypress/e2e/images/images-custom-list-loadmore.cy.js index 40b787cf1..a74530de2 100644 --- a/cypress/e2e/images/images-custom-list-loadmore.cy.js +++ b/cypress/e2e/images/images-custom-list-loadmore.cy.js @@ -50,7 +50,7 @@ describe('Open custom list of images in viewer with pagination', function() { .should('contain', 'image4.jpg') }) - it('Open the viewer with a specific list', async function() { + it('Open the viewer with a specific list', function() { // make sure we only loadMore once let loaded = false @@ -112,7 +112,7 @@ describe('Open custom list of images in viewer with pagination', function() { etag: 'etag456', }, ] - } + }, }) }) }) diff --git a/cypress/e2e/mixins/oddname.js b/cypress/e2e/mixins/oddname.js index a2770e39f..43157c7ac 100644 --- a/cypress/e2e/mixins/oddname.js +++ b/cypress/e2e/mixins/oddname.js @@ -48,6 +48,12 @@ Cypress.on('fail', (error, runnable) => { throw error // throw error to have test still fail }) +/** + * + * @param file + * @param type + * @param sidebar + */ export default function(file, type, sidebar = false) { const placedName = naughtyFileName(file) @@ -79,6 +85,9 @@ export default function(file, type, sidebar = false) { cy.openFile(folderName) }) + /** + * + */ function noLoadingAnimation() { cy.get('body > .viewer', { timeout: 10000 }) .should('be.visible') @@ -86,6 +95,9 @@ export default function(file, type, sidebar = false) { .and('not.have.class', 'icon-loading') } + /** + * + */ function menuOk() { cy.get('body > .viewer .icon-error').should('not.exist') cy.get('body > .viewer .modal-title').should('contain', placedName) @@ -94,6 +106,9 @@ export default function(file, type, sidebar = false) { ) } + /** + * + */ function arrowsOK() { cy.get('body > .viewer button.prev').should('not.be.visible') cy.get('body > .viewer button.next').should('not.be.visible') diff --git a/cypress/e2e/videos/video.webm.cy.js b/cypress/e2e/videos/video.webm.cy.js index 4d21a2a0b..0d10a6c28 100644 --- a/cypress/e2e/videos/video.webm.cy.js +++ b/cypress/e2e/videos/video.webm.cy.js @@ -24,4 +24,4 @@ import videoTest from '../mixins/video.js' describe('Open video.webm in viewer', function() { videoTest('video.webm', 'video/webm') -}) \ No newline at end of file +}) diff --git a/cypress/e2e/visual-regression.cy.js b/cypress/e2e/visual-regression.cy.js index 2b3716851..0ac912606 100644 --- a/cypress/e2e/visual-regression.cy.js +++ b/cypress/e2e/visual-regression.cy.js @@ -81,6 +81,7 @@ describe('Visual regression tests ', function() { video.get(0).currentTime = 1 }) // wait a bit for things to be settled + // eslint-disable-next-line cy.wait(250) cy.compareSnapshot('video', 0.02) }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index ae3cfd567..a61023e76 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -23,7 +23,7 @@ import { addCommands, User } from '@nextcloud/cypress' import { basename } from 'path' import axios from '@nextcloud/axios' -import compareSnapshotCommand from 'cypress-visual-regression/dist/command' +import compareSnapshotCommand from 'cypress-visual-regression/dist/command.js' addCommands() compareSnapshotCommand() @@ -96,6 +96,7 @@ Cypress.Commands.add('createFolder', (user, target) => { Cypress.Commands.add('openFile', fileName => { cy.get(`.files-fileList tr[data-file="${CSS.escape(fileName)}"] a.name`).click() + // eslint-disable-next-line cy.wait(250) }) @@ -113,7 +114,7 @@ Cypress.Commands.add('deleteFile', fileName => { * Create a share link and return the share url * * @param {string} path the file/folder path - * @returns {string} the share link url + * @return {string} the share link url */ Cypress.Commands.add('createLinkShare', path => { return cy.window().then(async window => { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index d68db96df..276fbf485 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -14,7 +14,4 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' - -// Alternatively you can use CommonJS syntax: -// require('./commands') +import './commands.js' diff --git a/package-lock.json b/package-lock.json index 26b1e29b6..0392e1dbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^2.3.0", "@nextcloud/cypress": "^1.0.0-beta.1", - "@nextcloud/eslint-config": "^8.1.5", + "@nextcloud/eslint-config": "^8.2.0", "@nextcloud/stylelint-config": "^2.3.0", "@nextcloud/webpack-vue-config": "^5.4.0", "@types/dockerode": "^3.3.14", @@ -3085,9 +3085,9 @@ "integrity": "sha512-QUJ5wVL8iTZofgZjCfVnHxcMqqPPLfVfEKe8rfksMdmSmqEenpcpEBQO45VSSfng/tunwoLF+3I8rzEzVhYNLQ==" }, "node_modules/@nextcloud/eslint-config": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-8.1.5.tgz", - "integrity": "sha512-LuGqF8/YzdKAUsdd60xmXBN8LBmXgU2cwVLAnG3j1kbXRydZOSQEdqcPOz9bAzp3J2yaq5sTR3ZeZapTH+Jljg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-8.2.0.tgz", + "integrity": "sha512-QssSQ3j8KPmXsu1CFxJLAR3v0b6U4b3Zkvdvrw2umd/2uNkKi7W4nPD/iZF2q/qduMvGhHQUd2TYs80gbMT6UA==", "dev": true, "engines": { "node": "^16.0.0", @@ -3097,6 +3097,7 @@ "@babel/core": "^7.13.10", "@babel/eslint-parser": "^7.16.5", "@nextcloud/eslint-plugin": "^2.0.0", + "@vue/eslint-config-typescript": "^11.0.2", "eslint": "^8.27.0", "eslint-config-standard": "^17.0.0", "eslint-plugin-import": "^2.26.0", @@ -3104,6 +3105,7 @@ "eslint-plugin-n": "^15.5.1", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-vue": "^9.7.0", + "typescript": "^4.9.4", "webpack": "^5.4.0" } }, @@ -3766,6 +3768,13 @@ "dev": true, "peer": true }, + "node_modules/@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true, + "peer": true + }, "node_modules/@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -3859,6 +3868,259 @@ "@types/node": "*" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz", + "integrity": "sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/type-utils": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz", + "integrity": "sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz", + "integrity": "sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz", + "integrity": "sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.1.tgz", + "integrity": "sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz", + "integrity": "sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.1.tgz", + "integrity": "sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz", + "integrity": "sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/types": "5.48.1", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@vue/compiler-core": { "version": "3.2.37", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.37.tgz", @@ -3994,6 +4256,31 @@ "dev": true, "peer": true }, + "node_modules/@vue/eslint-config-typescript": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.2.tgz", + "integrity": "sha512-EiKud1NqlWmSapBFkeSrE994qpKx7/27uCGnhdqzllYDpQZroyX/O6bwjEpeuyKamvLbsGdO6PMR2faIf+zFnw==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "vue-eslint-parser": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0", + "eslint-plugin-vue": "^9.0.0", + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@vue/reactivity": { "version": "3.2.37", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.37.tgz", @@ -12957,6 +13244,13 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true, + "peer": true + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -16766,6 +17060,29 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "peer": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "peer": true + }, "node_modules/tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", @@ -20610,9 +20927,9 @@ } }, "@nextcloud/eslint-config": { - "version": "8.1.5", - "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-8.1.5.tgz", - "integrity": "sha512-LuGqF8/YzdKAUsdd60xmXBN8LBmXgU2cwVLAnG3j1kbXRydZOSQEdqcPOz9bAzp3J2yaq5sTR3ZeZapTH+Jljg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/eslint-config/-/eslint-config-8.2.0.tgz", + "integrity": "sha512-QssSQ3j8KPmXsu1CFxJLAR3v0b6U4b3Zkvdvrw2umd/2uNkKi7W4nPD/iZF2q/qduMvGhHQUd2TYs80gbMT6UA==", "dev": true, "requires": {} }, @@ -21192,6 +21509,13 @@ "dev": true, "peer": true }, + "@types/semver": { + "version": "7.3.13", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", + "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "dev": true, + "peer": true + }, "@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -21285,6 +21609,157 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.1.tgz", + "integrity": "sha512-9nY5K1Rp2ppmpb9s9S2aBiF3xo5uExCehMDmYmmFqqyxgenbHJ3qbarcLt4ITgaD6r/2ypdlcFRdcuVPnks+fQ==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/type-utils": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.1.tgz", + "integrity": "sha512-4yg+FJR/V1M9Xoq56SF9Iygqm+r5LMXvheo6DQ7/yUWynQ4YfCRnsKuRgqH4EQ5Ya76rVwlEpw4Xu+TgWQUcdA==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.1.tgz", + "integrity": "sha512-S035ueRrbxRMKvSTv9vJKIWgr86BD8s3RqoRZmsSh/s8HhIs90g6UlK8ZabUSjUZQkhVxt7nmZ63VJ9dcZhtDQ==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.1.tgz", + "integrity": "sha512-Hyr8HU8Alcuva1ppmqSYtM/Gp0q4JOp1F+/JH5D1IZm/bUBrV0edoewQZiEc1r6I8L4JL21broddxK8HAcZiqQ==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/typescript-estree": "5.48.1", + "@typescript-eslint/utils": "5.48.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.1.tgz", + "integrity": "sha512-xHyDLU6MSuEEdIlzrrAerCGS3T7AA/L8Hggd0RCYBi0w3JMvGYxlLlXHeg50JI9Tfg5MrtsfuNxbS/3zF1/ATg==", + "dev": true, + "peer": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.1.tgz", + "integrity": "sha512-Hut+Osk5FYr+sgFh8J/FHjqX6HFcDzTlWLrFqGoK5kVUN3VBHF/QzZmAsIXCQ8T/W9nQNBTqalxi1P3LSqWnRA==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/visitor-keys": "5.48.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.1.tgz", + "integrity": "sha512-SmQuSrCGUOdmGMwivW14Z0Lj8dxG1mOFZ7soeJ0TQZEJcs3n5Ndgkg0A4bcMFzBELqLJ6GTHnEU+iIoaD6hFGA==", + "dev": true, + "peer": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.48.1", + "@typescript-eslint/types": "5.48.1", + "@typescript-eslint/typescript-estree": "5.48.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" + }, + "dependencies": { + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "peer": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.48.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.1.tgz", + "integrity": "sha512-Ns0XBwmfuX7ZknznfXozgnydyR8F6ev/KEGePP4i74uL3ArsKbEhJ7raeKr1JSa997DBDwol/4a0Y+At82c9dA==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/types": "5.48.1", + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "peer": true + } + } + }, "@vue/compiler-core": { "version": "3.2.37", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.37.tgz", @@ -21408,6 +21883,18 @@ } } }, + "@vue/eslint-config-typescript": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.2.tgz", + "integrity": "sha512-EiKud1NqlWmSapBFkeSrE994qpKx7/27uCGnhdqzllYDpQZroyX/O6bwjEpeuyKamvLbsGdO6PMR2faIf+zFnw==", + "dev": true, + "peer": true, + "requires": { + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "vue-eslint-parser": "^9.0.0" + } + }, "@vue/reactivity": { "version": "3.2.37", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.37.tgz", @@ -28311,6 +28798,13 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true, + "peer": true + }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -31246,6 +31740,25 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "peer": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "peer": true + } + } + }, "tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", diff --git a/package.json b/package.json index a655f87c0..76e883f0f 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "build": "webpack --node-env production --progress", "dev": "webpack --node-env development --progress", "watch": "webpack --node-env development --progress --watch", - "lint": "eslint --ext .js,.vue src", - "lint:fix": "eslint --ext .js,.vue src --fix", + "lint": "eslint --ext .ts,.js,.vue cypress src", + "lint:fix": "eslint --ext .ts,.js,.vue cypress src --fix", "stylelint": "stylelint src", "stylelint:fix": "stylelint src --fix", "cypress": "npm run cypress:e2e", @@ -73,7 +73,7 @@ "@nextcloud/babel-config": "^1.0.0", "@nextcloud/browserslist-config": "^2.3.0", "@nextcloud/cypress": "^1.0.0-beta.1", - "@nextcloud/eslint-config": "^8.1.5", + "@nextcloud/eslint-config": "^8.2.0", "@nextcloud/stylelint-config": "^2.3.0", "@nextcloud/webpack-vue-config": "^5.4.0", "@types/dockerode": "^3.3.14",