Skip to content

Commit

Permalink
bump typescript-eslint (#9479)
Browse files Browse the repository at this point in the history
evergreen

## Description

Extracted from #9476 because that's blocked on a potential TS bug.

Bumps https://typescript-eslint.io/ to latest.

They [deprecated ts-prefer-expect-error](https://www.github.com/typescript-eslint/typescript-eslint/pull/9081/) so I migrated the config to the new way.

It also added an [allowForKnownSafePromises](https://typescript-eslint.io/rules/no-floating-promises/#allowforknownsafepromises) option to no-floating-promises but I don't see any compelling uses for that.

### Security Considerations

none, lint
### Scaling Considerations

none, lint

### Documentation Considerations
none


### Testing Considerations

CI


### Upgrade Considerations

none, lint
  • Loading branch information
mergify[bot] authored Jul 6, 2024
2 parents 115adc4 + 7f4d952 commit 2c28414
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 123 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ module.exports = {
reportUnusedDisableDirectives: true,

rules: {
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
// TODO tighten to 'allow-with-description' (42 unexplained atm)
'ts-expect-error': false,
// TODO make this error (start with `src` sans codegen)
'ts-nocheck': false,
},
],
'@typescript-eslint/no-floating-promises': 'error',
// so that floating-promises can be explicitly permitted with void operator
'no-void': ['error', { allowAsStatement: true }],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.5.2",
"typescript-eslint": "^7.7.1"
"typescript-eslint": "^7.15.0"
},
"resolutions": {
"**/protobufjs": "^7.2.6",
"**/@types/estree": "^1.0.0",
"**/@typescript-eslint/typescript-estree": "^7.7.1"
"**/@typescript-eslint/typescript-estree": "^7.13.1"
},
"engines": {
"node": "^18.12 || ^20.9"
Expand Down
18 changes: 2 additions & 16 deletions packages/async-flow/src/replay-membrane.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,7 @@ export const makeReplayMembrane = ({
try {
optVerb
? heapVowE.sendOnly(hostTarget)[optVerb](...hostArgs)
: // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore once we changed this from E to heapVowE,
// typescript started complaining that heapVowE(hostTarget)
// is not callable. I'm not sure if this is a just a typing bug
// in heapVowE or also reflects a runtime deficiency. But this
// case it not used yet anyway. We disable it
// with at-ts-ignore rather than at-ts-expect-error because
// the dependency-graph tests complains that the latter is unused.
: // @ts-expect-error XXX heapVowE
heapVowE.sendOnly(hostTarget)(...hostArgs);
} catch (hostProblem) {
throw Panic`internal: eventual sendOnly synchrously failed ${hostProblem}`;
Expand Down Expand Up @@ -320,14 +313,7 @@ export const makeReplayMembrane = ({
try {
const hostPromise = optVerb
? heapVowE(hostTarget)[optVerb](...hostArgs)
: // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore once we changed this from E to heapVowE,
// typescript started complaining that heapVowE(hostTarget)
// is not callable. I'm not sure if this is a just a typing bug
// in heapVowE or also reflects a runtime deficiency. But this
// case it not used yet anyway. We disable it
// with at-ts-ignore rather than at-ts-expect-error because
// the dependency-graph tests complains that the latter is unused.
: // @ts-expect-error XXX heapVowE
heapVowE(hostTarget)(...hostArgs);
resolver.resolve(hostPromise); // TODO does this always work?
} catch (hostProblem) {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"peerDependencies": {
"@endo/eslint-plugin": "^2.1.3",
"@jessie.js/eslint-plugin": "^0.4.1",
"typescript-eslint": "^7.2.0",
"typescript-eslint": "^7.13.1",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-github": "^4.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/zone/src/durable.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const makeDurableZone = (baggage, baseLabel = 'durableZone') => {
/** @type {import('.').Zone['exoClass']} */
const exoClass = (...args) => prepareExoClass(baggage, ...args);
/** @type {import('.').Zone['exoClassKit']} */
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- happens only integrating with Endo master
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- happens only integrating with Endo master
// @ts-ignore FIXME in Endo
const exoClassKit = (...args) => prepareExoClassKit(baggage, ...args);
/** @type {import('.').Zone['exo']} */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js
index 087f2a0..6778549 100644
index 567ff5d..f1e1684 100644
--- a/node_modules/node-fetch/lib/index.js
+++ b/node_modules/node-fetch/lib/index.js
@@ -1,3 +1,4 @@
Expand Down Expand Up @@ -34,7 +34,7 @@ index 087f2a0..6778549 100644

let convert;
try {
@@ -1400,10 +1415,7 @@ function AbortError(message) {
@@ -1396,10 +1411,7 @@ function AbortError(message) {
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
Expand Down
Loading

0 comments on commit 2c28414

Please sign in to comment.