Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz committed Jan 20, 2024
1 parent 5515d0c commit 77fcdcb
Show file tree
Hide file tree
Showing 38 changed files with 246 additions and 208 deletions.
29 changes: 15 additions & 14 deletions packages/docusaurus/src/pages/package.tsx
Expand Up @@ -4,6 +4,21 @@ import { useLocation } from "@docusaurus/router";
import { DocsSidebarProvider } from "@docusaurus/theme-common/internal";
import { HtmlClassNameProvider } from "@docusaurus/theme-common";
import Editor from "@monaco-editor/react";
import { normalizeRepoUrl } from "@yarnpkg/monorepo/packages/plugin-git/sources/utils/normalizeRepoUrl";
import clsx from "clsx";
import gitUrlParse from "git-url-parse";
import Select, { MenuListProps } from "react-select";
import { FixedSizeList } from "react-window";
import React, { Suspense, useReducer } from "react";
import semver from "semver";
import { useLocalStorage } from "usehooks-ts";

import { usePackageInfo, useReleaseFile, useReleaseInfo, useReleaseReadme, useResolvedVersion } from "../lib/npmTools";
import { Check, checks } from "../lib/packageChecks";
import Layout from "../theme/DocPage/Layout/index";

import styles from "./package.module.css";

import {
AlertIcon,
ArrowLeftIcon,
Expand All @@ -19,20 +34,6 @@ import {
PlayIcon,
TagIcon,
} from "@primer/octicons-react";
import { normalizeRepoUrl } from "@yarnpkg/monorepo/packages/plugin-git/sources/utils/normalizeRepoUrl";
import clsx from "clsx";
import gitUrlParse from "git-url-parse";
import Select, { MenuListProps } from "react-select";
import { FixedSizeList } from "react-window";
import React, { Suspense, useReducer } from "react";
import semver from "semver";
import { useLocalStorage } from "usehooks-ts";

import { usePackageInfo, useReleaseFile, useReleaseInfo, useReleaseReadme, useResolvedVersion } from "../lib/npmTools";
import { Check, checks } from "../lib/packageChecks";
import Layout from "../theme/DocPage/Layout/index";

import styles from "./package.module.css";

const SidebarEntry = ({ icon: Icon, name, extra }: { icon: React.FunctionComponent; name: string; extra?: string }) => (
<div className={styles.sidebarEntry}>
Expand Down
11 changes: 6 additions & 5 deletions packages/plugin-compat/tests/patches.test.ts
@@ -1,3 +1,9 @@
import { PortablePath, xfs, ppath } from "@yarnpkg/fslib";
import NpmPlugin from "@yarnpkg/plugin-npm";
import PatchPlugin from "@yarnpkg/plugin-patch";

import CompatPlugin from "../sources/index";

import {
Configuration,
Descriptor,
Expand All @@ -9,11 +15,6 @@ import {
Cache,
LocatorHash,
} from "@yarnpkg/core";
import { PortablePath, xfs, ppath } from "@yarnpkg/fslib";
import NpmPlugin from "@yarnpkg/plugin-npm";
import PatchPlugin from "@yarnpkg/plugin-patch";

import CompatPlugin from "../sources/index";

function getConfiguration(p: PortablePath) {
return Configuration.create(
Expand Down
11 changes: 6 additions & 5 deletions packages/plugin-constraints/sources/constraintUtils.ts
@@ -1,3 +1,9 @@
import { PortablePath } from "@yarnpkg/fslib";
import get from "lodash/get";
import set from "lodash/set";
import toPath from "lodash/toPath";
import unset from "lodash/unset";

import {
Configuration,
formatUtils,
Expand All @@ -8,11 +14,6 @@ import {
treeUtils,
Workspace,
} from "@yarnpkg/core";
import { PortablePath } from "@yarnpkg/fslib";
import get from "lodash/get";
import set from "lodash/set";
import toPath from "lodash/toPath";
import unset from "lodash/unset";

export type ProcessResult = {
manifestUpdates: Map<PortablePath, Map<string, Map<any, Set<nodeUtils.Caller>>>>;
Expand Down
7 changes: 4 additions & 3 deletions packages/plugin-essentials/sources/commands/config.ts
@@ -1,4 +1,8 @@
import { BaseCommand } from "@yarnpkg/cli";
import { npath } from "@yarnpkg/fslib";
import { Command, Option, Usage } from "clipanion";
import { inspect } from "util";

import {
Configuration,
MessageName,
Expand All @@ -7,9 +11,6 @@ import {
reportOptionDeprecations,
treeUtils,
} from "@yarnpkg/core";
import { npath } from "@yarnpkg/fslib";
import { Command, Option, Usage } from "clipanion";
import { inspect } from "util";

// eslint-disable-next-line arca/no-default-export
export default class ConfigCommand extends BaseCommand {
Expand Down
9 changes: 5 additions & 4 deletions packages/plugin-essentials/sources/commands/explain.ts
@@ -1,4 +1,9 @@
import { BaseCommand } from "@yarnpkg/cli";
import { Option, Command } from "clipanion";
import * as t from "typanion";

import { resolveTag } from "./set/version";

import {
Configuration,
MessageName,
Expand All @@ -10,10 +15,6 @@ import {
parseMessageName,
stringifyMessageName,
} from "@yarnpkg/core";
import { Option, Command } from "clipanion";
import * as t from "typanion";

import { resolveTag } from "./set/version";

function getCodeName(code: string): string {
return MessageName[parseMessageName(code)];
Expand Down
@@ -1,4 +1,8 @@
import { BaseCommand } from "@yarnpkg/cli";
import { Command, Option } from "clipanion";
import { Writable } from "stream";
import * as t from "typanion";

import {
Configuration,
MessageName,
Expand All @@ -9,9 +13,6 @@ import {
formatUtils,
PeerWarningType,
} from "@yarnpkg/core";
import { Command, Option } from "clipanion";
import { Writable } from "stream";
import * as t from "typanion";

// eslint-disable-next-line arca/no-default-export
export default class ExplainPeerRequirementsCommand extends BaseCommand {
Expand Down
11 changes: 6 additions & 5 deletions packages/plugin-essentials/sources/commands/info.ts
@@ -1,4 +1,10 @@
import { BaseCommand, WorkspaceRequiredError } from "@yarnpkg/cli";
import { xfs } from "@yarnpkg/fslib";
import { Command, Option, Usage, UsageError } from "clipanion";
import mm from "micromatch";

import { Hooks } from "..";

import {
Configuration,
Project,
Expand All @@ -15,11 +21,6 @@ import {
Manifest,
treeUtils,
} from "@yarnpkg/core";
import { xfs } from "@yarnpkg/fslib";
import { Command, Option, Usage, UsageError } from "clipanion";
import mm from "micromatch";

import { Hooks } from "..";

// eslint-disable-next-line arca/no-default-export
export default class InfoCommand extends BaseCommand {
Expand Down
13 changes: 7 additions & 6 deletions packages/plugin-essentials/sources/commands/install.ts
@@ -1,4 +1,11 @@
import { BaseCommand, WorkspaceRequiredError } from "@yarnpkg/cli";
import { xfs, ppath, Filename, PortablePath } from "@yarnpkg/fslib";
import { parseSyml, stringifySyml } from "@yarnpkg/parsers";
import CI from "ci-info";
import { Command, Option, Usage, UsageError } from "clipanion";
import semver from "semver";
import * as t from "typanion";

import {
Configuration,
Cache,
Expand All @@ -16,12 +23,6 @@ import {
httpUtils,
reportOptionDeprecations,
} from "@yarnpkg/core";
import { xfs, ppath, Filename, PortablePath } from "@yarnpkg/fslib";
import { parseSyml, stringifySyml } from "@yarnpkg/parsers";
import CI from "ci-info";
import { Command, Option, Usage, UsageError } from "clipanion";
import semver from "semver";
import * as t from "typanion";

const LOCKFILE_MIGRATION_RULES: Array<{
selector: (version: number) => boolean;
Expand Down
@@ -1,4 +1,12 @@
import { BaseCommand } from "@yarnpkg/cli";
import { Filename, PortablePath, npath, ppath, xfs } from "@yarnpkg/fslib";
import { Command, Option, Usage } from "clipanion";
import { tmpdir } from "os";

import { buildAndSavePlugin, BuildAndSavePluginsSpec } from "../../plugin/import/sources";
import { getAvailablePlugins } from "../../plugin/list";
import { setVersion } from "../version";

import {
Configuration,
MessageName,
Expand All @@ -10,13 +18,6 @@ import {
hashUtils,
Project,
} from "@yarnpkg/core";
import { Filename, PortablePath, npath, ppath, xfs } from "@yarnpkg/fslib";
import { Command, Option, Usage } from "clipanion";
import { tmpdir } from "os";

import { buildAndSavePlugin, BuildAndSavePluginsSpec } from "../../plugin/import/sources";
import { getAvailablePlugins } from "../../plugin/list";
import { setVersion } from "../version";

const PR_REGEXP = /^[0-9]+$/;
const IS_WIN32 = process.platform === `win32`;
Expand Down
15 changes: 8 additions & 7 deletions packages/plugin-essentials/sources/commands/up.ts
@@ -1,6 +1,14 @@
import { BaseCommand, WorkspaceRequiredError } from "@yarnpkg/cli";
import { IdentHash, structUtils } from "@yarnpkg/core";
import { Project, Workspace, InstallMode } from "@yarnpkg/core";
import { Command, Option, Usage, UsageError } from "clipanion";
import { prompt } from "enquirer";
import micromatch from "micromatch";
import * as t from "typanion";

import * as suggestUtils from "../suggestUtils";
import { Hooks } from "..";

import {
Cache,
Configuration,
Expand All @@ -10,13 +18,6 @@ import {
MinimalResolveOptions,
formatUtils,
} from "@yarnpkg/core";
import { Command, Option, Usage, UsageError } from "clipanion";
import { prompt } from "enquirer";
import micromatch from "micromatch";
import * as t from "typanion";

import * as suggestUtils from "../suggestUtils";
import { Hooks } from "..";

// eslint-disable-next-line arca/no-default-export
export default class UpCommand extends BaseCommand {
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-essentials/sources/dedupeUtils.ts
@@ -1,3 +1,6 @@
import { formatUtils, structUtils, IdentHash, LocatorHash, MessageName, Fetcher, FetchOptions } from "@yarnpkg/core";
import micromatch from "micromatch";

import {
Project,
ResolveOptions,
Expand All @@ -10,8 +13,6 @@ import {
Cache,
DescriptorHash,
} from "@yarnpkg/core";
import { formatUtils, structUtils, IdentHash, LocatorHash, MessageName, Fetcher, FetchOptions } from "@yarnpkg/core";
import micromatch from "micromatch";

export type PackageUpdate = {
descriptor: Descriptor;
Expand Down
7 changes: 4 additions & 3 deletions packages/plugin-essentials/sources/suggestUtils.ts
@@ -1,3 +1,7 @@
import { formatUtils, structUtils, semverUtils } from "@yarnpkg/core";
import { PortablePath, ppath, xfs } from "@yarnpkg/fslib";
import semver from "semver";

import {
Cache,
DescriptorHash,
Expand All @@ -12,9 +16,6 @@ import {
ResolveOptions,
Configuration,
} from "@yarnpkg/core";
import { formatUtils, structUtils, semverUtils } from "@yarnpkg/core";
import { PortablePath, ppath, xfs } from "@yarnpkg/fslib";
import semver from "semver";

const WORKSPACE_PROTOCOL = `workspace:`;

Expand Down
17 changes: 9 additions & 8 deletions packages/plugin-git/sources/gitUtils.ts
@@ -1,3 +1,12 @@
import { Filename, npath, PortablePath, ppath, xfs } from "@yarnpkg/fslib";
import { UsageError } from "clipanion";
import GitUrlParse from "git-url-parse";
import capitalize from "lodash/capitalize";
import querystring from "querystring";
import semver from "semver";

import { normalizeRepoUrl } from "./utils/normalizeRepoUrl";

import {
Configuration,
Hooks,
Expand All @@ -12,14 +21,6 @@ import {
MessageName,
formatUtils,
} from "@yarnpkg/core";
import { Filename, npath, PortablePath, ppath, xfs } from "@yarnpkg/fslib";
import { UsageError } from "clipanion";
import GitUrlParse from "git-url-parse";
import capitalize from "lodash/capitalize";
import querystring from "querystring";
import semver from "semver";

import { normalizeRepoUrl } from "./utils/normalizeRepoUrl";

export { normalizeRepoUrl };

Expand Down
@@ -1,4 +1,12 @@
import { BaseCommand, WorkspaceRequiredError } from "@yarnpkg/cli";
import * as libuiUtils from "@yarnpkg/libui/sources/libuiUtils";
import type { SubmitInjectedComponent } from "@yarnpkg/libui/sources/misc/renderForm";
import { suggestUtils } from "@yarnpkg/plugin-essentials";
import { Command, Usage } from "clipanion";
import { diffWords } from "diff";
import semver from "semver";
import { WriteStream } from "tty";

import {
Cache,
Configuration,
Expand All @@ -10,13 +18,6 @@ import {
Descriptor,
DescriptorHash,
} from "@yarnpkg/core";
import * as libuiUtils from "@yarnpkg/libui/sources/libuiUtils";
import type { SubmitInjectedComponent } from "@yarnpkg/libui/sources/misc/renderForm";
import { suggestUtils } from "@yarnpkg/plugin-essentials";
import { Command, Usage } from "clipanion";
import { diffWords } from "diff";
import semver from "semver";
import { WriteStream } from "tty";

const SIMPLE_SEMVER = /^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;

Expand Down
17 changes: 9 additions & 8 deletions packages/plugin-npm-cli/sources/commands/npm/audit.ts
@@ -1,4 +1,13 @@
import { BaseCommand, WorkspaceRequiredError } from "@yarnpkg/cli";
import { structUtils } from "@yarnpkg/core";
import { npmConfigUtils, npmHttpUtils } from "@yarnpkg/plugin-npm";
import { Command, Option, Usage } from "clipanion";
import micromatch from "micromatch";
import * as t from "typanion";

import * as npmAuditTypes from "../../npmAuditTypes";
import * as npmAuditUtils from "../../npmAuditUtils";

import {
Configuration,
Project,
Expand All @@ -11,14 +20,6 @@ import {
Locator,
miscUtils,
} from "@yarnpkg/core";
import { structUtils } from "@yarnpkg/core";
import { npmConfigUtils, npmHttpUtils } from "@yarnpkg/plugin-npm";
import { Command, Option, Usage } from "clipanion";
import micromatch from "micromatch";
import * as t from "typanion";

import * as npmAuditTypes from "../../npmAuditTypes";
import * as npmAuditUtils from "../../npmAuditUtils";

// eslint-disable-next-line arca/no-default-export
export default class NpmAuditCommand extends BaseCommand {
Expand Down
7 changes: 4 additions & 3 deletions packages/plugin-npm-cli/sources/npmAuditUtils.ts
@@ -1,3 +1,7 @@
import semver from "semver";

import * as npmAuditTypes from "./npmAuditTypes";

import {
Project,
Workspace,
Expand All @@ -9,9 +13,6 @@ import {
Locator,
LocatorHash,
} from "@yarnpkg/core";
import semver from "semver";

import * as npmAuditTypes from "./npmAuditTypes";

export const allSeverities = [
npmAuditTypes.Severity.Info,
Expand Down

0 comments on commit 77fcdcb

Please sign in to comment.