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 eslint #6236

Merged
merged 4 commits into from
Mar 18, 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.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions __utils__/assert-project/src/index.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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