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

style: update @automattic/eslint-plugin-wpvip to 0.8.0 and apply style fixes #1538

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 3 additions & 6 deletions __tests__/bin/vip-cache-purge-url.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/**
* Internal dependencies
*/
import * as tracker from '../../src/lib/tracker';
import * as exit from '../../src/lib/cli/exit';
import * as purgeCacheLib from '../../src/lib/api/cache-purge';
import { cachePurgeCommand } from '../../src/bin/vip-cache-purge-url';
import * as purgeCacheLib from '../../src/lib/api/cache-purge';
import * as exit from '../../src/lib/cli/exit';
import { readFromFile } from '../../src/lib/read-file';
import * as tracker from '../../src/lib/tracker';

jest.spyOn( console, 'log' ).mockImplementation( () => {} );
jest.spyOn( exit, 'withError' ).mockImplementation( () => {
Expand Down
6 changes: 0 additions & 6 deletions __tests__/bin/vip-config-envvar-delete.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/**
* External dependencies
*/
import { describe, expect, it, jest, beforeEach } from '@jest/globals';

/**
* Internal dependencies
*/
import { deleteEnvVarCommand } from '../../src/bin/vip-config-envvar-delete';
import command from '../../src/lib/cli/command';
import { deleteEnvVar, validateNameWithMessage } from '../../src/lib/envvar/api';
Expand Down
7 changes: 0 additions & 7 deletions __tests__/bin/vip-config-envvar-get-all.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* External dependencies
*/

/**
* Internal dependencies
*/
import { getAllEnvVarsCommand } from '../../src/bin/vip-config-envvar-get-all';
import command from '../../src/lib/cli/command';
import { formatData } from '../../src/lib/cli/format';
Expand Down
7 changes: 0 additions & 7 deletions __tests__/bin/vip-config-envvar-get.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* External dependencies
*/

/**
* Internal dependencies
*/
import { getEnvVarCommand } from '../../src/bin/vip-config-envvar-get';
import command from '../../src/lib/cli/command';
import { getEnvVar } from '../../src/lib/envvar/api';
Expand Down
7 changes: 0 additions & 7 deletions __tests__/bin/vip-config-envvar-list.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* External dependencies
*/

/**
* Internal dependencies
*/
import { listEnvVarsCommand } from '../../src/bin/vip-config-envvar-list';
import command from '../../src/lib/cli/command';
import { formatData } from '../../src/lib/cli/format';
Expand Down
6 changes: 0 additions & 6 deletions __tests__/bin/vip-config-envvar-set.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/**
* External dependencies
*/
import { describe, expect, it, jest } from '@jest/globals';

/**
* Internal dependencies
*/
import { setEnvVarCommand } from '../../src/bin/vip-config-envvar-set';
import command from '../../src/lib/cli/command';
import { setEnvVar, validateNameWithMessage } from '../../src/lib/envvar/api';
Expand Down
6 changes: 0 additions & 6 deletions __tests__/bin/vip-import-sql.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/**
* External dependencies
*/
import path from 'path';

/**
* Internal dependencies
*/
import { validateAndGetTableNames, gates } from '../../src/bin/vip-import-sql';
import * as exit from '../../src/lib/cli/exit';

Expand Down
8 changes: 3 additions & 5 deletions __tests__/bin/vip-logs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/**
* Internal dependencies
*/
import os from 'os';
import * as tracker from '../../src/lib/tracker';

import { getLogs } from '../../src/bin/vip-logs';
import * as logsLib from '../../src/lib/app-logs/app-logs';
import * as exit from '../../src/lib/cli/exit';
import { getLogs } from '../../src/bin/vip-logs';
import * as tracker from '../../src/lib/tracker';

jest.spyOn( console, 'log' ).mockImplementation( () => {} );
jest.spyOn( console, 'error' ).mockImplementation( () => {} );
Expand Down
8 changes: 3 additions & 5 deletions __tests__/bin/vip-slowlogs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/**
* Internal dependencies
*/
import os from 'os';
import * as tracker from '../../src/lib/tracker';

import { getSlowlogs } from '../../src/bin/vip-slowlogs';
import * as slowlogsLib from '../../src/lib/app-slowlogs/app-slowlogs';
import * as exit from '../../src/lib/cli/exit';
import { getSlowlogs } from '../../src/bin/vip-slowlogs';
import * as tracker from '../../src/lib/tracker';

jest.spyOn( console, 'log' ).mockImplementation( () => {} );
jest.spyOn( console, 'error' ).mockImplementation( () => {} );
Expand Down
9 changes: 3 additions & 6 deletions __tests__/bin/vip-whoami.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
* Internal dependencies
*/
import * as tracker from '../../src/lib/tracker';
import * as exit from '../../src/lib/cli/exit';
import * as apiUserLib from '../../src/lib/api/user';
import { whoamiCommand } from '../../src/bin/vip-whoami';
import * as apiUserLib from '../../src/lib/api/user';
import * as exit from '../../src/lib/cli/exit';
import * as tracker from '../../src/lib/tracker';

jest.spyOn( console, 'log' ).mockImplementation( () => {} );
jest.spyOn( exit, 'withError' ).mockImplementation( () => {
Expand Down
9 changes: 2 additions & 7 deletions __tests__/commands/backup-db.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-return */
/**
* External dependencies
*/

/**
* Internal dependencies
*/
import { beforeEach, describe, expect, it, jest } from '@jest/globals';

import { BackupDBCommand } from '../../src/commands/backup-db';
import API from '../../src/lib/api';
import { beforeEach, describe, expect, it, jest } from '@jest/globals';

const mockApp = {
id: 123,
Expand Down
11 changes: 2 additions & 9 deletions __tests__/commands/dev-env-sync-sql.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/**
* External dependencies
*/
import { describe, expect, jest } from '@jest/globals';
import fs from 'fs';
import { replace } from '@automattic/vip-search-replace';
import fs from 'fs';
import { PassThrough } from 'stream';

/**
* Internal dependencies
*/
import { DevEnvImportSQLCommand } from '../../src/commands/dev-env-import-sql';
import { DevEnvSyncSQLCommand } from '../../src/commands/dev-env-sync-sql';
import { ExportSQLCommand } from '../../src/commands/export-sql';
import { DevEnvImportSQLCommand } from '../../src/commands/dev-env-import-sql';
import { unzipFile } from '../../src/lib/client-file-uploader';
import { getReadInterface } from '../../src/lib/validations/line-by-line';

Expand Down
7 changes: 0 additions & 7 deletions __tests__/commands/export-sql.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* External dependencies
*/

/**
* Internal dependencies
*/
import {
ExportSQLCommand,
CREATE_EXPORT_JOB_MUTATION,
Expand Down
14 changes: 4 additions & 10 deletions __tests__/devenv-e2e/001-create.spec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/**
* External dependencies
*/
import { describe, expect, it, jest } from '@jest/globals';
import { mkdtemp, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { readEnvironmentData } from '../../src/lib/dev-environment/dev-environment-core';
import { checkEnvExists, getProjectSlug, prepareEnvironment } from './helpers/utils';
import { vipDevEnvCreate } from './helpers/commands';
import { checkEnvExists, getProjectSlug, prepareEnvironment } from './helpers/utils';
import { readEnvironmentData } from '../../src/lib/dev-environment/dev-environment-core';

jest.setTimeout( 30 * 1000 );

Expand Down
20 changes: 7 additions & 13 deletions __tests__/devenv-e2e/002-destroy.spec.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
/**
* External dependencies
*/
import { access, mkdtemp, rm, unlink } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import xdgBaseDir from 'xdg-basedir';
import Docker from 'dockerode';
import nock from 'nock';
import { access, mkdtemp, rm, unlink } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { getEnvironmentPath } from '../../src/lib/dev-environment/dev-environment-core';
import { vipDevEnvCreate, vipDevEnvDestroy } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';
import {
checkEnvExists,
createAndStartEnvironment,
destroyEnvironment,
getProjectSlug,
prepareEnvironment,
} from './helpers/utils';
import { vipDevEnvCreate, vipDevEnvDestroy } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';
import { getEnvironmentPath } from '../../src/lib/dev-environment/dev-environment-core';

jest.setTimeout( 600 * 1000 ).retryTimes( 1, { logErrorsBeforeRetry: true } );

Expand Down
18 changes: 6 additions & 12 deletions __tests__/devenv-e2e/003-start.spec.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
/**
* External dependencies
*/
import { mkdtemp, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import xdgBaseDir from 'xdg-basedir';
import Docker from 'dockerode';
import nock from 'nock';
import { mkdtemp, rm } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { vipDevEnvStart } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';
import {
checkEnvExists,
createAndStartEnvironment,
destroyEnvironment,
getProjectSlug,
prepareEnvironment,
} from './helpers/utils';
import { vipDevEnvStart } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';

jest.setTimeout( 600 * 1000 ).retryTimes( 1, { logErrorsBeforeRetry: true } );

Expand Down
18 changes: 6 additions & 12 deletions __tests__/devenv-e2e/004-stop.spec.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
/**
* External dependencies
*/
import { mkdtemp, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { afterAll, describe, expect, it, jest } from '@jest/globals';
import xdgBaseDir from 'xdg-basedir';
import Docker from 'dockerode';
import nock from 'nock';
import { mkdtemp, rm } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { vipDevEnvStop } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';
import {
checkEnvExists,
createAndStartEnvironment,
destroyEnvironment,
getProjectSlug,
prepareEnvironment,
} from './helpers/utils';
import { vipDevEnvStop } from './helpers/commands';
import { getContainersForProject, killProjectContainers } from './helpers/docker-utils';

jest.setTimeout( 600 * 1000 ).retryTimes( 1, { logErrorsBeforeRetry: true } );

Expand Down
14 changes: 4 additions & 10 deletions __tests__/devenv-e2e/005-update.spec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/**
* External dependencies
*/
import { describe, expect, it, jest } from '@jest/globals';
import { copyFile, mkdir, mkdtemp, readFile, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { readEnvironmentData } from '../../src/lib/dev-environment/dev-environment-core';
import { checkEnvExists, getProjectSlug, prepareEnvironment } from './helpers/utils';
import { vipDevEnvCreate, vipDevEnvUpdate } from './helpers/commands';
import { checkEnvExists, getProjectSlug, prepareEnvironment } from './helpers/utils';
import { readEnvironmentData } from '../../src/lib/dev-environment/dev-environment-core';

jest.setTimeout( 30 * 1000 );

Expand Down
18 changes: 6 additions & 12 deletions __tests__/devenv-e2e/006-list.spec.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
/**
* External dependencies
*/
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import xdgBaseDir from 'xdg-basedir';
import Docker from 'dockerode';
import nock from 'nock';
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { vipDevEnvCreate, vipDevEnvList } from './helpers/commands';
import { killProjectContainers } from './helpers/docker-utils';
import {
checkEnvExists,
createAndStartEnvironment,
getProjectSlug,
prepareEnvironment,
} from './helpers/utils';
import { vipDevEnvCreate, vipDevEnvList } from './helpers/commands';
import { killProjectContainers } from './helpers/docker-utils';
import { getEnvironmentPath } from '../../src/lib/dev-environment/dev-environment-core';

jest.setTimeout( 60 * 1000 ).retryTimes( 1, { logErrorsBeforeRetry: true } );
Expand Down
16 changes: 5 additions & 11 deletions __tests__/devenv-e2e/007-info.spec.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
/**
* External dependencies
*/
import { mkdtemp, rm } from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { describe, expect, it, jest } from '@jest/globals';
import xdgBaseDir from 'xdg-basedir';
import Docker from 'dockerode';
import nock from 'nock';
import { mkdtemp, rm } from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import xdgBaseDir from 'xdg-basedir';

/**
* Internal dependencies
*/
import { CliTest } from './helpers/cli-test';
import { createAndStartEnvironment, getProjectSlug, prepareEnvironment } from './helpers/utils';
import { vipDevEnvCreate, vipDevEnvInfo } from './helpers/commands';
import { killProjectContainers } from './helpers/docker-utils';
import { createAndStartEnvironment, getProjectSlug, prepareEnvironment } from './helpers/utils';

jest.setTimeout( 30 * 1000 ).retryTimes( 1, { logErrorsBeforeRetry: true } );

Expand Down
Loading