Skip to content

Commit

Permalink
style: update eslint (#6236)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Mar 18, 2023
1 parent f15fde7 commit ee61ca4
Show file tree
Hide file tree
Showing 397 changed files with 1,265 additions and 1,226 deletions.
6 changes: 3 additions & 3 deletions __utils__/assert-project/src/index.ts
@@ -1,15 +1,15 @@
import path from 'path'
import { assertStore } from '@pnpm/assert-store'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { LockfileV6 as Lockfile, ProjectSnapshotV6 as ProjectSnapshot } from '@pnpm/lockfile-types'
import { Modules, readModulesManifest } from '@pnpm/modules-yaml'
import { type LockfileV6 as Lockfile, type ProjectSnapshotV6 as ProjectSnapshot } from '@pnpm/lockfile-types'
import { type Modules, readModulesManifest } from '@pnpm/modules-yaml'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import readYamlFile from 'read-yaml-file'
import exists from 'path-exists'
import writePkg from 'write-pkg'
import isExecutable from './isExecutable'

export { isExecutable, Modules }
export { isExecutable, type Modules }

export type RawLockfile = Lockfile & Partial<ProjectSnapshot>

Expand Down
1 change: 1 addition & 0 deletions __utils__/eslint-config/eslint.json
Expand Up @@ -60,6 +60,7 @@
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/ban-ts-comment": "off",
"brace-style": [
"error",
"1tbs"
Expand Down
4 changes: 2 additions & 2 deletions __utils__/eslint-config/package.json
Expand Up @@ -25,8 +25,8 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"eslint-config-standard-with-typescript": "^26.0.0",
"eslint": "^8.36.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-node": "^11.1.0",
Expand Down
6 changes: 3 additions & 3 deletions __utils__/prepare/src/index.ts
@@ -1,13 +1,13 @@
import fs from 'fs'
import path from 'path'
import { assertProject, Modules, Project } from '@pnpm/assert-project'
import { ProjectManifest } from '@pnpm/types'
import { assertProject, type Modules, type Project } from '@pnpm/assert-project'
import { type ProjectManifest } from '@pnpm/types'
import uniqueString from 'unique-string'
import { sync as writeJson5File } from 'write-json5-file'
import { sync as writeYamlFile } from 'write-yaml-file'
import writePkg from 'write-pkg'

export { Modules, Project }
export type { Modules, Project }
export type ManifestFormat = 'JSON' | 'JSON5' | 'YAML'

// The testing folder should be outside of the project to avoid lookup in the project's node_modules
Expand Down
2 changes: 1 addition & 1 deletion cli/cli-meta/src/index.ts
@@ -1,5 +1,5 @@
import path from 'path'
import { DependencyManifest } from '@pnpm/types'
import { type DependencyManifest } from '@pnpm/types'
import loadJsonFile from 'load-json-file'

const defaultManifest = {
Expand Down
2 changes: 1 addition & 1 deletion cli/cli-utils/src/getConfig.ts
@@ -1,5 +1,5 @@
import { packageManager } from '@pnpm/cli-meta'
import { getConfig as _getConfig, CliOptions } from '@pnpm/config'
import { getConfig as _getConfig, type CliOptions } from '@pnpm/config'
import { formatWarn } from '@pnpm/default-reporter'

export async function getConfig (
Expand Down
2 changes: 1 addition & 1 deletion cli/cli-utils/src/packageIsInstallable.ts
@@ -1,6 +1,6 @@
import { packageManager } from '@pnpm/cli-meta'
import { logger } from '@pnpm/logger'
import { checkPackage, UnsupportedEngineError, WantedEngine } from '@pnpm/package-is-installable'
import { checkPackage, UnsupportedEngineError, type WantedEngine } from '@pnpm/package-is-installable'

export function packageIsInstallable (
pkgPath: string,
Expand Down
2 changes: 1 addition & 1 deletion cli/cli-utils/src/readProjectManifest.ts
@@ -1,5 +1,5 @@
import * as utils from '@pnpm/read-project-manifest'
import { ProjectManifest } from '@pnpm/types'
import { type ProjectManifest } from '@pnpm/types'
import { packageIsInstallable } from './packageIsInstallable'

export async function readProjectManifest (
Expand Down
6 changes: 3 additions & 3 deletions cli/default-reporter/src/index.ts
@@ -1,6 +1,6 @@
import { Config } from '@pnpm/config'
import * as logs from '@pnpm/core-loggers'
import { LogLevel } from '@pnpm/logger'
import { type Config } from '@pnpm/config'
import type * as logs from '@pnpm/core-loggers'
import { type LogLevel } from '@pnpm/logger'
import * as Rx from 'rxjs'
import { filter, map, mergeAll } from 'rxjs/operators'
import createDiffer from 'ansi-diff'
Expand Down
8 changes: 4 additions & 4 deletions cli/default-reporter/src/reportError.ts
@@ -1,8 +1,8 @@
import { Config } from '@pnpm/config'
import { Log } from '@pnpm/core-loggers'
import { PnpmError } from '@pnpm/error'
import { type Config } from '@pnpm/config'
import { type Log } from '@pnpm/core-loggers'
import { type PnpmError } from '@pnpm/error'
import { renderPeerIssues } from '@pnpm/render-peer-issues'
import { PeerDependencyIssuesByProjects } from '@pnpm/types'
import { type PeerDependencyIssuesByProjects } from '@pnpm/types'
import chalk from 'chalk'
import equals from 'ramda/src/equals'
import StackTracey from 'stacktracey'
Expand Down
8 changes: 4 additions & 4 deletions cli/default-reporter/src/reporterForClient/index.ts
@@ -1,7 +1,7 @@
import { Config } from '@pnpm/config'
import * as logs from '@pnpm/core-loggers'
import { LogLevel } from '@pnpm/logger'
import * as Rx from 'rxjs'
import { type Config } from '@pnpm/config'
import type * as logs from '@pnpm/core-loggers'
import { type LogLevel } from '@pnpm/logger'
import type * as Rx from 'rxjs'
import { throttleTime } from 'rxjs/operators'
import { reportBigTarballProgress } from './reportBigTarballsProgress'
import { reportContext } from './reportContext'
Expand Down
4 changes: 2 additions & 2 deletions cli/default-reporter/src/reporterForClient/pkgsDiff.ts
@@ -1,5 +1,5 @@
import * as logs from '@pnpm/core-loggers'
import { PackageManifest } from '@pnpm/types'
import type * as logs from '@pnpm/core-loggers'
import { type PackageManifest } from '@pnpm/types'
import * as Rx from 'rxjs'
import { filter, map, mapTo, reduce, scan, startWith, take } from 'rxjs/operators'
import mergeRight from 'ramda/src/mergeRight'
Expand Down
@@ -1,5 +1,5 @@
import { FetchingProgressLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { type FetchingProgressLog } from '@pnpm/core-loggers'
import type * as Rx from 'rxjs'
import { filter, map, startWith } from 'rxjs/operators'
import prettyBytes from 'pretty-bytes'
import {
Expand Down
@@ -1,5 +1,5 @@
import path from 'path'
import { ContextLog, PackageImportMethodLog } from '@pnpm/core-loggers'
import { type ContextLog, type PackageImportMethodLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map, take } from 'rxjs/operators'
import normalize from 'normalize-path'
Expand Down
@@ -1,4 +1,4 @@
import { DeprecationLog } from '@pnpm/core-loggers'
import { type DeprecationLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map } from 'rxjs/operators'
import chalk from 'chalk'
Expand Down
@@ -1,5 +1,5 @@
import prettyMs from 'pretty-ms'
import { ExecutionTimeLog } from '@pnpm/core-loggers'
import { type ExecutionTimeLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map, take } from 'rxjs/operators'

Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/src/reporterForClient/reportHooks.ts
@@ -1,4 +1,4 @@
import { HookLog } from '@pnpm/core-loggers'
import { type HookLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map } from 'rxjs/operators'
import chalk from 'chalk'
Expand Down
@@ -1,4 +1,4 @@
import { InstallCheckLog } from '@pnpm/core-loggers'
import { type InstallCheckLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { filter, map } from 'rxjs/operators'
import { formatWarn } from './utils/formatWarn'
Expand Down
@@ -1,5 +1,5 @@
import path from 'path'
import { LifecycleLog } from '@pnpm/core-loggers'
import { type LifecycleLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { buffer, filter, groupBy, map, mergeAll, mergeMap } from 'rxjs/operators'
import chalk from 'chalk'
Expand Down
6 changes: 3 additions & 3 deletions cli/default-reporter/src/reporterForClient/reportMisc.ts
@@ -1,7 +1,7 @@
import os from 'os'
import { Config } from '@pnpm/config'
import { Log, RegistryLog } from '@pnpm/core-loggers'
import { LogLevel } from '@pnpm/logger'
import { type Config } from '@pnpm/config'
import { type Log, type RegistryLog } from '@pnpm/core-loggers'
import { type LogLevel } from '@pnpm/logger'
import * as Rx from 'rxjs'
import { filter, map } from 'rxjs/operators'
import { reportError } from '../reportError'
Expand Down
@@ -1,4 +1,4 @@
import { PeerDependencyIssuesLog } from '@pnpm/core-loggers'
import { type PeerDependencyIssuesLog } from '@pnpm/core-loggers'
import { renderPeerIssues } from '@pnpm/render-peer-issues'
import * as Rx from 'rxjs'
import { map, take } from 'rxjs/operators'
Expand Down
@@ -1,4 +1,4 @@
import { ProgressLog, StageLog } from '@pnpm/core-loggers'
import { type ProgressLog, type StageLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { filter, map, mapTo, takeWhile, startWith, take } from 'rxjs/operators'
import { hlValue } from './outputConstants'
Expand Down
@@ -1,4 +1,4 @@
import { RequestRetryLog } from '@pnpm/core-loggers'
import { type RequestRetryLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map } from 'rxjs/operators'
import prettyMilliseconds from 'pretty-ms'
Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/src/reporterForClient/reportScope.ts
@@ -1,4 +1,4 @@
import { ScopeLog } from '@pnpm/core-loggers'
import { type ScopeLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { map, take } from 'rxjs/operators'

Expand Down
@@ -1,4 +1,4 @@
import { SkippedOptionalDependencyLog } from '@pnpm/core-loggers'
import { type SkippedOptionalDependencyLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { filter, map } from 'rxjs/operators'

Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/src/reporterForClient/reportStats.ts
@@ -1,4 +1,4 @@
import { StatsLog } from '@pnpm/core-loggers'
import { type StatsLog } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { filter, take, reduce, map } from 'rxjs/operators'
import chalk from 'chalk'
Expand Down
12 changes: 6 additions & 6 deletions cli/default-reporter/src/reporterForClient/reportSummary.ts
@@ -1,19 +1,19 @@
import path from 'path'
import {
DeprecationLog,
PackageManifestLog,
RootLog,
SummaryLog,
type DeprecationLog,
type PackageManifestLog,
type RootLog,
type SummaryLog,
} from '@pnpm/core-loggers'
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'
import * as Rx from 'rxjs'
import { map, take } from 'rxjs/operators'
import chalk from 'chalk'
import semver from 'semver'
import { EOL } from '../constants'
import {
getPkgsDiff,
PackageDiff,
type PackageDiff,
propertyByDependencyType,
} from './pkgsDiff'
import {
Expand Down
@@ -1,4 +1,4 @@
import { UpdateCheckLog } from '@pnpm/core-loggers'
import { type UpdateCheckLog } from '@pnpm/core-loggers'
import boxen from 'boxen'
import chalk from 'chalk'
import * as Rx from 'rxjs'
Expand Down
6 changes: 3 additions & 3 deletions cli/default-reporter/src/reporterForServer.ts
@@ -1,6 +1,6 @@
import { Config } from '@pnpm/config'
import { Log } from '@pnpm/core-loggers'
import * as Rx from 'rxjs'
import { type Config } from '@pnpm/config'
import { type Log } from '@pnpm/core-loggers'
import type * as Rx from 'rxjs'
import chalk from 'chalk'
import { reportError } from './reportError'

Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/test/filterLogHook.ts
@@ -1,4 +1,4 @@
import { Log } from '@pnpm/core-loggers'
import { type Log } from '@pnpm/core-loggers'
import { toOutput$ } from '@pnpm/default-reporter'
import { logger, createStreamParser } from '@pnpm/logger'

Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/test/index.ts
@@ -1,6 +1,6 @@
/// <reference path="../../../__typings__/index.d.ts"/>
import path from 'path'
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'
import {
deprecationLogger,
hookLogger,
Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/test/reportingProgress.ts
@@ -1,4 +1,4 @@
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'
import {
fetchingProgressLogger,
progressLogger,
Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/test/reportingScope.ts
@@ -1,4 +1,4 @@
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'
import { scopeLogger } from '@pnpm/core-loggers'
import { toOutput$ } from '@pnpm/default-reporter'
import { createStreamParser } from '@pnpm/logger'
Expand Down
2 changes: 1 addition & 1 deletion cli/default-reporter/test/reportingUpdateCheck.ts
@@ -1,4 +1,4 @@
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'
import { updateCheckLogger } from '@pnpm/core-loggers'
import { toOutput$ } from '@pnpm/default-reporter'
import { createStreamParser } from '@pnpm/logger'
Expand Down
2 changes: 1 addition & 1 deletion cli/parse-cli-args/test/index.ts
@@ -1,5 +1,5 @@
import os from 'os'
import { PnpmError } from '@pnpm/error'
import { type PnpmError } from '@pnpm/error'
import { parseCliArgs } from '@pnpm/parse-cli-args'
import tempy from 'tempy'

Expand Down
8 changes: 4 additions & 4 deletions config/config/src/Config.ts
@@ -1,8 +1,8 @@
import {
Project,
ProjectManifest,
ProjectsGraph,
Registries,
type Project,
type ProjectManifest,
type ProjectsGraph,
type Registries,
} from '@pnpm/types'
import type { Hooks } from '@pnpm/pnpmfile'

Expand Down
8 changes: 4 additions & 4 deletions config/config/src/index.ts
Expand Up @@ -18,15 +18,15 @@ import { checkGlobalBinDir } from './checkGlobalBinDir'
import { getScopeRegistries } from './getScopeRegistries'
import { getCacheDir, getConfigDir, getDataDir, getStateDir } from './dirs'
import {
Config,
ConfigWithDeprecatedSettings,
UniversalOptions,
type Config,
type ConfigWithDeprecatedSettings,
type UniversalOptions,
} from './Config'
import { getWorkspaceConcurrency } from './concurrency'

export * from './readLocalConfig'

export { Config, UniversalOptions }
export type { Config, UniversalOptions }

const npmDefaults = loadNpmConf.defaults

Expand Down
2 changes: 1 addition & 1 deletion config/config/test/index.ts
Expand Up @@ -4,7 +4,7 @@ import path from 'path'
import PATH from 'path-name'
import { getCurrentBranch } from '@pnpm/git-utils'
import { getConfig } from '@pnpm/config'
import { PnpmError } from '@pnpm/error'
import { type PnpmError } from '@pnpm/error'
import loadNpmConf from '@pnpm/npm-conf'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
Expand Down
2 changes: 1 addition & 1 deletion config/normalize-registries/src/index.ts
@@ -1,4 +1,4 @@
import { Registries } from '@pnpm/types'
import { type Registries } from '@pnpm/types'
import normalizeRegistryUrl from 'normalize-registry-url'
import mapValues from 'ramda/src/map'

Expand Down
8 changes: 4 additions & 4 deletions config/package-is-installable/src/index.ts
Expand Up @@ -2,17 +2,17 @@ import {
installCheckLogger,
skippedOptionalDependencyLogger,
} from '@pnpm/core-loggers'
import { checkEngine, UnsupportedEngineError, WantedEngine } from './checkEngine'
import { checkEngine, UnsupportedEngineError, type WantedEngine } from './checkEngine'
import { checkPlatform, UnsupportedPlatformError } from './checkPlatform'
import { getSystemNodeVersion } from './getSystemNodeVersion'

export { Engine } from './checkEngine'
export { Platform, WantedPlatform } from './checkPlatform'
export type { Engine } from './checkEngine'
export type { Platform, WantedPlatform } from './checkPlatform'

export {
UnsupportedEngineError,
UnsupportedPlatformError,
WantedEngine,
type WantedEngine,
}

export function packageIsInstallable (
Expand Down
2 changes: 1 addition & 1 deletion config/pick-registry-for-package/src/index.ts
@@ -1,4 +1,4 @@
import { Registries } from '@pnpm/types'
import { type Registries } from '@pnpm/types'

export function pickRegistryForPackage (registries: Registries, packageName: string, pref?: string) {
const scope = getScope(packageName, pref)
Expand Down
2 changes: 1 addition & 1 deletion config/plugin-commands-config/src/ConfigCommandOptions.ts
@@ -1,4 +1,4 @@
import { Config } from '@pnpm/config'
import { type Config } from '@pnpm/config'

export type ConfigCommandOptions = Pick<Config,
| 'configDir'
Expand Down
2 changes: 1 addition & 1 deletion config/plugin-commands-config/src/config.ts
Expand Up @@ -4,7 +4,7 @@ import renderHelp from 'render-help'
import { configGet } from './configGet'
import { configSet } from './configSet'
import { configList } from './configList'
import { ConfigCommandOptions } from './ConfigCommandOptions'
import { type ConfigCommandOptions } from './ConfigCommandOptions'

export function rcOptionsTypes () {
return {}
Expand Down
2 changes: 1 addition & 1 deletion config/plugin-commands-config/src/configGet.ts
@@ -1,4 +1,4 @@
import { ConfigCommandOptions } from './ConfigCommandOptions'
import { type ConfigCommandOptions } from './ConfigCommandOptions'

export function configGet (opts: ConfigCommandOptions, key: string) {
return opts.rawConfig[key]
Expand Down

0 comments on commit ee61ca4

Please sign in to comment.