Skip to content

Commit

Permalink
chore(deps): update typescript eslint monorepo packages (major semver…
Browse files Browse the repository at this point in the history
… bump) (#8514)

Also updated checkDeps.ts to lint the root package.json for unused packages
  • Loading branch information
mmaietta authored Sep 20, 2024
1 parent 59767b0 commit 7dceec7
Show file tree
Hide file tree
Showing 29 changed files with 164 additions and 774 deletions.
17 changes: 15 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
plugins: [
"@typescript-eslint",
'@stylistic',
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -13,9 +16,11 @@ module.exports = {
project: ["./packages/*/tsconfig.json"],
},
rules: {
"@typescript-eslint/no-require-imports": "off",
semi: "off",
"prettier/prettier": "warn",
"@typescript-eslint/member-delimiter-style": [
"@typescript-eslint/prefer-promise-reject-errors": "off",
"@stylistic/member-delimiter-style": [
"error",
{
multiline: {
Expand All @@ -34,6 +39,14 @@ module.exports = {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-constant-condition": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/explicit-function-return-type": [
"off",
Expand Down
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,22 @@
"@babel/plugin-transform-modules-commonjs": "7.24.8",
"@changesets/changelog-github": "0.4.7",
"@changesets/cli": "2.25.0",
"@stylistic/eslint-plugin": "^2.8.0",
"@types/node": "^22.5.5",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"conventional-changelog-cli": "5.0.0",
"dmd": "6.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fs-extra": "10.1.0",
"husky": "7.0.4",
"jest-cli": "27.5.1",
"lint-staged": "15.2.7",
"path-sort": "0.1.0",
"prettier": "3.3.3",
"source-map-support": "0.5.21",
"ts-jsdoc": "3.2.2",
"typedoc": "^0.26",
"typedoc-plugin-markdown": "^4.2.7",
"typescript": "^5.5",
"typescript-json-schema": "0.64.0",
"v8-compile-cache": "2.3.0"
"typescript-json-schema": "0.64.0"
},
"engines": {
"node": ">=14.14",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/ProtonFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ProtonFramework extends LibUiFramework {
} else {
try {
babel = require("babel-core")
} catch (e: any) {
} catch (_e: any) {
// babel isn't installed
log.debug(null, "don't transpile source code using Babel")
return null
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/asar/asarFileChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function checkFileInArchive(asarFile: string, relativeFile: string,
let stat: Node | null
try {
stat = fs.getFile(relativeFile)
} catch (e: any) {
} catch (_e: any) {
const fileStat = await statOrNull(asarFile)
if (fileStat == null) {
throw error(`does not exist. Seems like a wrong configuration.`)
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/asar/asarUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class AsarPackager {
}

private writeAsarFile(fileSets: Array<ResolvedFileSet>, unpackedFileIndexMap: Map<ResolvedFileSet, Set<number>>): Promise<any> {
return new Promise((resolve, reject) => {
return new Promise<string>((resolve, reject) => {
const headerPickle = pickle.createEmpty()
headerPickle.writeString(JSON.stringify(this.fs.header))
const headerBuf = headerPickle.toBuffer()
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/fileMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class FileMatcher {
from: string,
to: string,
readonly macroExpander: (pattern: string) => string,
patterns?: Array<string> | string | null | undefined
patterns?: Array<string> | string | null
) {
this.from = ensureNoEndSlash(macroExpander(from))
this.to = ensureNoEndSlash(macroExpander(to))
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function requireProviderClass(provider: string, packager: Packager): any | null
let module: any = null
try {
module = require(path.join(packager.buildResourcesDir, name + ".js"))
} catch (ignored) {
} catch (_ignored) {
log.debug({ path: path.join(packager.buildResourcesDir, name + ".js") }, "Unable to find publish provider in build resources")
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/util/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function getConfig(
let file = "electron-webpack/out/electron-builder.js"
try {
file = require.resolve(file)
} catch (ignore) {
} catch (_ignore) {
file = require.resolve("electron-webpack/electron-builder.yml")
}
config.extends = `file:${file}`
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/util/config/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export async function loadParentConfig<T>(request: ReadConfigRequest, spec: stri
let resolved: string | null = null
try {
resolved = require.resolve(spec)
} catch (e) {
} catch (_e) {
// ignore
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/util/packageMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function authors(file: string, data: any) {
let authorData
try {
authorData = await readFile(path.resolve(path.dirname(file), "AUTHORS"), "utf8")
} catch (ignored) {
} catch (_ignored) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util-runtime/src/CancellationToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class CancellationToken extends EventEmitter {
try {
this.removeListener("cancel", cancelHandler)
cancelHandler = null
} catch (ignore) {
} catch (_ignore) {
// ignore
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function exists(file: string): Promise<boolean> {
try {
await access(file)
return true
} catch (e: any) {
} catch (_e: any) {
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dmg-builder/src/dmg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ async function customizeDmg(volumePath: string, specification: DmgOptions, packa
}
try {
await executePython("python3")
} catch (error: any) {
} catch (_error: any) {
await executePython("python")
}
return packager.packagerOptions.effectiveOptionComputed == null || !(await packager.packagerOptions.effectiveOptionComputed({ volumePath, specification, packager }))
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-updater/src/DownloadedUpdateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DownloadedUpdateHelper {
try {
// remove stale data
await emptyDir(this.cacheDirForPendingUpdate)
} catch (ignore) {
} catch (_ignore) {
// ignore
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-updater/src/NsisUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class NsisUpdater extends BaseUpdater {
} catch (e: any) {
try {
await unlink(packageFile)
} catch (ignored) {
} catch (_ignored) {
// ignore
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export abstract class DifferentialDownloader {
} catch (errorOnLog) {
try {
console.error(errorOnLog)
} catch (ignored) {
} catch (_ignored) {
// ok, give up and ignore error
}
}
Expand Down
Loading

0 comments on commit 7dceec7

Please sign in to comment.