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

devDeps: bump @metamask/eslint-config* to ^12.1.0 #96

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ module.exports = {
{
files: ['*.ts'],
extends: ['@metamask/eslint-config-typescript'],
rules: {
'@typescript-eslint/naming-convention': 'off',
'n/no-process-env': 'off',
'id-length': 'off',
},
},

{
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,36 @@
"debug": "^4.3.4",
"execa": "^5.1.1",
"pony-cause": "^2.1.9",
"semver": "^7.5.0",
"semver": "^7.5.4",
"which": "^3.0.0",
"yaml": "^2.2.2",
"yargs": "^17.7.1"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1",
"@metamask/auto-changelog": "^3.0.0",
"@metamask/eslint-config": "^10.0.0",
"@metamask/eslint-config-jest": "^10.0.0",
"@metamask/eslint-config-nodejs": "^10.0.0",
"@metamask/eslint-config-typescript": "^10.0.0",
"@metamask/eslint-config": "^12.1.0",
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@types/debug": "^4.1.7",
"@types/jest": "^29.5.1",
"@types/jest-when": "^3.5.2",
"@types/node": "^17.0.23",
"@types/rimraf": "^4.0.5",
"@types/which": "^3.0.0",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"deepmerge": "^4.2.2",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.5.0",
"jest-it-up": "^2.0.2",
"jest-when": "^3.5.2",
Expand All @@ -67,7 +68,7 @@
"stdio-mock": "^1.2.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.7.0",
"typescript": "~4.8.4"
"typescript": "~5.1.6"
},
"packageManager": "yarn@3.2.1",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/command-line-arguments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import yargs from 'yargs/yargs';
import { hideBin } from 'yargs/helpers';
import yargs from 'yargs/yargs';

export type CommandLineArguments = {
projectDirectory: string;
Expand Down
1 change: 1 addition & 0 deletions src/editor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { when } from 'jest-when';

import { determineEditor } from './editor';
import * as envModule from './env';
import * as miscUtils from './misc-utils';
Expand Down
2 changes: 2 additions & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function determineEditor(): Promise<Editor | null> {
executablePath = await resolveExecutable(EDITOR);
} catch (error) {
debug(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Could not resolve executable ${EDITOR} (${error}), falling back to VSCode`,
);
}
Expand All @@ -43,6 +44,7 @@ export async function determineEditor(): Promise<Editor | null> {
executableArgs.push('--wait');
} catch (error) {
debug(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`Could not resolve path to VSCode: ${error}, continuing regardless`,
);
}
Expand Down
11 changes: 8 additions & 3 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ type Env = {
* this tool needs to access, whether their values are defined or not.
*/
export function getEnvironmentVariables(): Env {
return ['EDITOR'].reduce((object, key) => {
return { ...object, [key]: process.env[key] };
}, {} as Env);
return ['EDITOR'].reduce(
(object, key) => {
return { ...object, [key]: process.env[key] };
},
{
EDITOR: undefined,
},
);
}
7 changes: 4 additions & 3 deletions src/fs.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as actionUtils from '@metamask/action-utils';
import fs from 'fs';
import { when } from 'jest-when';
import path from 'path';
import { rimraf } from 'rimraf';
import { when } from 'jest-when';
import * as actionUtils from '@metamask/action-utils';
import { withSandbox } from '../tests/helpers';

import {
readFile,
writeFile,
Expand All @@ -13,6 +13,7 @@ import {
ensureDirectoryPathExists,
removeFile,
} from './fs';
import { withSandbox } from '../tests/helpers';

jest.mock('@metamask/action-utils');

Expand Down
3 changes: 2 additions & 1 deletion src/fs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'fs';
import {
readJsonObjectFile as underlyingReadJsonObjectFile,
writeJsonFile as underlyingWriteJsonFile,
} from '@metamask/action-utils';
import fs from 'fs';

import { wrapError, isErrorWithCode } from './misc-utils';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/functional.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withMonorepoProjectEnvironment } from '../tests/functional/helpers/with';
import { buildChangelog } from '../tests/functional/helpers/utils';
import { withMonorepoProjectEnvironment } from '../tests/functional/helpers/with';

jest.setTimeout(10_000);

Expand Down
11 changes: 6 additions & 5 deletions src/initial-parameters.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { when } from 'jest-when';
import os from 'os';
import path from 'path';
import { when } from 'jest-when';

import * as commandLineArgumentsModule from './command-line-arguments';
import * as envModule from './env';
import { determineInitialParameters } from './initial-parameters';
import * as projectModule from './project';
import {
buildMockProject,
buildMockPackage,
createNoopWriteStream,
} from '../tests/unit/helpers';
import { determineInitialParameters } from './initial-parameters';
import * as commandLineArgumentsModule from './command-line-arguments';
import * as envModule from './env';
import * as projectModule from './project';

jest.mock('./command-line-arguments');
jest.mock('./env');
Expand Down
6 changes: 4 additions & 2 deletions src/initial-parameters.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os from 'os';
import path from 'path';

import { readCommandLineArguments } from './command-line-arguments';
import { WriteStreamLike } from './fs';
import { readProject, Project } from './project';
import type { WriteStreamLike } from './fs';
import type { Project } from './project';
import { readProject } from './project';

/**
* The type of release being created as determined by the parent release.
Expand Down
5 changes: 3 additions & 2 deletions src/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'fs';
import { buildMockProject } from '../tests/unit/helpers';
import { main } from './main';

import * as initialParametersModule from './initial-parameters';
import { main } from './main';
import * as monorepoWorkflowOperations from './monorepo-workflow-operations';
import { buildMockProject } from '../tests/unit/helpers';

jest.mock('./initial-parameters');
jest.mock('./monorepo-workflow-operations');
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { WriteStream } from 'fs';

import { determineInitialParameters } from './initial-parameters';
import { followMonorepoWorkflow } from './monorepo-workflow-operations';

Expand Down
3 changes: 2 additions & 1 deletion src/misc-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as whichModule from 'which';
import * as execaModule from 'execa';
import * as whichModule from 'which';

import {
isErrorWithCode,
isErrorWithMessage,
Expand Down
13 changes: 7 additions & 6 deletions src/misc-utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import which from 'which';
import execa from 'execa';
import { isObject } from '@metamask/utils';
import createDebug from 'debug';
import execa from 'execa';
import { ErrorWithCause } from 'pony-cause';
import { isObject } from '@metamask/utils';
import which from 'which';

export { isTruthyString } from '@metamask/action-utils';
export { hasProperty, isNullOrUndefined } from '@metamask/utils';
Expand Down Expand Up @@ -91,6 +91,7 @@ export function wrapError(message: string, originalError: unknown) {
return error;
}

// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
return new Error(`${message}: ${originalError}`);
}

Expand Down Expand Up @@ -130,7 +131,7 @@ export async function resolveExecutable(
export async function runCommand(
command: string,
args?: readonly string[] | undefined,
options?: execa.Options<string> | undefined,
options?: execa.Options | undefined,
): Promise<void> {
await execa(command, args, options);
}
Expand All @@ -149,7 +150,7 @@ export async function runCommand(
export async function getStdoutFromCommand(
command: string,
args?: readonly string[] | undefined,
options?: execa.Options<string> | undefined,
options?: execa.Options | undefined,
): Promise<string> {
return (await execa(command, args, options)).stdout.trim();
}
Expand All @@ -167,7 +168,7 @@ export async function getStdoutFromCommand(
export async function getLinesFromCommand(
command: string,
args?: readonly string[] | undefined,
options?: execa.Options<string> | undefined,
options?: execa.Options | undefined,
): Promise<string[]> {
const { stdout } = await execa(command, args, options);
return stdout.split('\n').filter((value) => value !== '');
Expand Down
17 changes: 10 additions & 7 deletions src/monorepo-workflow-operations.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import fs from 'fs';
import path from 'path';
import { when } from 'jest-when';
import path from 'path';
import { MockWritable } from 'stdio-mock';
import { withSandbox, Sandbox, isErrorWithCode } from '../tests/helpers';
import { buildMockProject, Require } from '../tests/unit/helpers';
import { followMonorepoWorkflow } from './monorepo-workflow-operations';

import * as editorModule from './editor';
import type { Editor } from './editor';
import { ReleaseType } from './initial-parameters';
import * as releaseSpecificationModule from './release-specification';
import type { ReleaseSpecification } from './release-specification';
import type { ReleaseType } from './initial-parameters';
import { followMonorepoWorkflow } from './monorepo-workflow-operations';
import * as releasePlanModule from './release-plan';
import type { ReleasePlan } from './release-plan';
import * as releaseSpecificationModule from './release-specification';
import type { ReleaseSpecification } from './release-specification';
import * as repoModule from './repo';
import { withSandbox, isErrorWithCode } from '../tests/helpers';
import type { Sandbox } from '../tests/helpers';
import { buildMockProject } from '../tests/unit/helpers';
import type { Require } from '../tests/unit/helpers';

jest.mock('./editor');
jest.mock('./release-plan');
Expand Down
9 changes: 5 additions & 4 deletions src/monorepo-workflow-operations.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import type { WriteStream } from 'fs';
import path from 'path';

import { determineEditor } from './editor';
import {
ensureDirectoryPathExists,
fileExists,
removeFile,
writeFile,
} from './fs';
import { determineEditor } from './editor';
import { ReleaseType } from './initial-parameters';
import { Project } from './project';
import type { ReleaseType } from './initial-parameters';
import type { Project } from './project';
import { planRelease, executeReleasePlan } from './release-plan';
import { captureChangesInReleaseBranch } from './repo';
import {
generateReleaseSpecificationTemplateForMonorepo,
waitForUserToEditReleaseSpecification,
validateReleaseSpecification,
} from './release-specification';
import { captureChangesInReleaseBranch } from './repo';

/**
* For a monorepo, the process works like this:
Expand Down
3 changes: 2 additions & 1 deletion src/package-manifest.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'fs';
import path from 'path';
import { SemVer } from 'semver';
import { withSandbox } from '../tests/helpers';

import { readPackageManifest } from './package-manifest';
import { withSandbox } from '../tests/helpers';

describe('package-manifest', () => {
describe('readPackageManifest', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/package-manifest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import path from 'path';
import {
ManifestFieldNames as PackageManifestFieldNames,
ManifestDependencyFieldNames as PackageManifestDependenciesFieldNames,
} from '@metamask/action-utils';
import { isPlainObject } from '@metamask/utils';
import path from 'path';

import { readJsonObjectFile } from './fs';
import { isTruthyString } from './misc-utils';
import { isValidSemver, SemVer } from './semver';
Expand Down
21 changes: 11 additions & 10 deletions src/package.test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import * as autoChangelog from '@metamask/auto-changelog';
import fs from 'fs';
import path from 'path';
import { when } from 'jest-when';
import * as autoChangelog from '@metamask/auto-changelog';
import path from 'path';
import { SemVer } from 'semver';
import { MockWritable } from 'stdio-mock';
import { withSandbox } from '../tests/helpers';
import {
buildMockPackage,
buildMockProject,
buildMockManifest,
createNoopWriteStream,
} from '../tests/unit/helpers';

import * as fsModule from './fs';
import {
readMonorepoRootPackage,
readMonorepoWorkspacePackage,
updatePackage,
} from './package';
import * as fsModule from './fs';
import * as packageManifestModule from './package-manifest';
import * as repoModule from './repo';
import { withSandbox } from '../tests/helpers';
import {
buildMockPackage,
buildMockProject,
buildMockManifest,
createNoopWriteStream,
} from '../tests/unit/helpers';

jest.mock('@metamask/auto-changelog');
jest.mock('./package-manifest');
Expand Down
Loading
Loading