Skip to content

Commit f4c4ad6

Browse files
committed
upgrade dependencies (graphql#4459)
1. typescript upgrade 2. add support for `await using` of our hand-crafted generators by providing `Symbol.asyncDispose` methods 3. eslint upgrades 4. drop unnecessary generic within `BoxedPromiseOrValue` that leads to error of unclear origin
1 parent ae1e5ae commit f4c4ad6

File tree

17 files changed

+841
-953
lines changed

17 files changed

+841
-953
lines changed

eslint.config.mjs

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default tsConfig(
5656
'internal-rules/require-to-string-tag': 'off',
5757

5858
//////////////////////////////////////////////////////////////////////////////
59-
// `eslint-plugin-n` rule list based on `v17.14.x`
59+
// `eslint-plugin-n` rule list based on `v17.21.x`
6060
//////////////////////////////////////////////////////////////////////////////
6161

6262
// Rules
@@ -83,6 +83,7 @@ export default tsConfig(
8383
'n/no-restricted-import': 'off',
8484
'n/no-restricted-require': 'off',
8585
'n/no-sync': 'off', // TODO: consider enabling, currently triggers with executeSync/graphqlSync, without ability to add exceptions
86+
'n/no-top-level-await': 'error',
8687
'n/no-unpublished-bin': 'error',
8788
'n/no-unpublished-import': 'error',
8889
'n/no-unpublished-require': 'error',
@@ -106,12 +107,13 @@ export default tsConfig(
106107
'n/shebang': 'error',
107108

108109
//////////////////////////////////////////////////////////////////////////////
109-
// `eslint-plugin-import` rule list based on `v2.31.x`
110+
// `eslint-plugin-import` rule list based on `v2.32.x`
110111
//////////////////////////////////////////////////////////////////////////////
111112

112113
// Static analysis
113114
// https://github.com/benmosher/eslint-plugin-import#static-analysis
114115
'import/default': 'error',
116+
'import/enforce-node-protocol-usage': ['error', 'always'],
115117
'import/named': 'error',
116118
'import/namespace': 'error',
117119
'import/no-absolute-path': 'error',
@@ -229,7 +231,7 @@ export default tsConfig(
229231
'simple-import-sort/exports': 'off', // TODO: error
230232

231233
//////////////////////////////////////////////////////////////////////////////
232-
// ESLint builtin rules list based on `v9.16.x`
234+
// ESLint builtin rules list based on `v9.31.x`
233235
//////////////////////////////////////////////////////////////////////////////
234236

235237
// Possible Errors
@@ -276,6 +278,7 @@ export default tsConfig(
276278
'no-sparse-arrays': 'error',
277279
'no-template-curly-in-string': 'error',
278280
'no-this-before-super': 'error',
281+
'no-unassigned-vars': 'error',
279282
'no-undef': 'error',
280283
'no-unexpected-multiline': 'error',
281284
'no-unmodified-loop-condition': 'error',
@@ -493,7 +496,7 @@ export default tsConfig(
493496
},
494497
rules: {
495498
//////////////////////////////////////////////////////////////////////////
496-
// `@typescript-eslint/eslint-plugin` rule list based on `v8.16.x`
499+
// `@typescript-eslint/eslint-plugin` rule list based on `v8.37.x`
497500
//////////////////////////////////////////////////////////////////////////
498501

499502
// Supported Rules
@@ -514,7 +517,7 @@ export default tsConfig(
514517
],
515518
'@typescript-eslint/ban-tslint-comment': 'error',
516519
'@typescript-eslint/class-literal-property-style': 'off', // TODO: enable after TS conversion
517-
'@typescript-eslint/class-methods-use-this': 'off',
520+
'@typescript-eslint/class-methods-use-this': 'off', // now in core
518521
'@typescript-eslint/consistent-generic-constructors': 'error',
519522
'@typescript-eslint/consistent-indexed-object-style': [
520523
'error',
@@ -525,32 +528,27 @@ export default tsConfig(
525528
'@typescript-eslint/consistent-type-definitions': 'error',
526529
'@typescript-eslint/consistent-type-exports': 'error',
527530
'@typescript-eslint/consistent-type-imports': 'error',
528-
'@typescript-eslint/default-param-last': 'error',
531+
'@typescript-eslint/default-param-last': 'off', // now in core
529532
'@typescript-eslint/dot-notation': 'error',
530533
'@typescript-eslint/explicit-function-return-type': 'off', // TODO: consider
531534
'@typescript-eslint/explicit-member-accessibility': 'off', // TODO: consider
532535
'@typescript-eslint/explicit-module-boundary-types': 'off', // TODO: consider
533-
'@typescript-eslint/init-declarations': 'off',
534-
'@typescript-eslint/max-params': [
535-
'error',
536-
{
537-
max: 5, // TODO: drop to default number, which is 3
538-
},
539-
],
536+
'@typescript-eslint/init-declarations': 'off', // now in core
537+
'@typescript-eslint/max-params': 'off', // now in core
540538
'@typescript-eslint/member-ordering': 'error',
541539
'@typescript-eslint/method-signature-style': 'error',
542540
'@typescript-eslint/naming-convention': 'off',
543-
'@typescript-eslint/no-array-constructor': 'error',
541+
'@typescript-eslint/no-array-constructor': 'off', // now in core
544542
'@typescript-eslint/no-array-delete': 'error',
545543
'@typescript-eslint/no-base-to-string': 'error',
546544
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
547545
'@typescript-eslint/no-confusing-void-expression': 'off', // TODO: enable with ignoreArrowShorthand
548546
'@typescript-eslint/no-deprecated': 'off',
549-
'@typescript-eslint/no-dupe-class-members': 'error',
547+
'@typescript-eslint/no-dupe-class-members': 'off', // now in core
550548
'@typescript-eslint/no-duplicate-enum-values': 'error',
551549
'@typescript-eslint/no-duplicate-type-constituents': 'error',
552550
'@typescript-eslint/no-dynamic-delete': 'off',
553-
'@typescript-eslint/no-empty-function': 'error',
551+
'@typescript-eslint/no-empty-function': 'off', // now in core
554552
'@typescript-eslint/no-empty-object-type': 'error',
555553
'@typescript-eslint/no-explicit-any': 'off', // TODO: error
556554
'@typescript-eslint/no-extra-non-null-assertion': 'error',
@@ -566,10 +564,10 @@ export default tsConfig(
566564
ignoreProperties: true,
567565
},
568566
],
569-
'@typescript-eslint/no-invalid-this': 'error',
567+
'@typescript-eslint/no-invalid-this': 'off', // now in core
570568
'@typescript-eslint/no-invalid-void-type': 'error',
571569
'@typescript-eslint/no-loop-func': 'error',
572-
'@typescript-eslint/no-magic-numbers': 'off',
570+
'@typescript-eslint/no-magic-numbers': 'off', // now in core
573571
'@typescript-eslint/no-meaningless-void-operator': 'error',
574572
'@typescript-eslint/no-misused-new': 'error',
575573
'@typescript-eslint/no-misused-promises': 'error',
@@ -583,7 +581,7 @@ export default tsConfig(
583581
'@typescript-eslint/no-require-imports': 'error',
584582
'@typescript-eslint/no-restricted-imports': 'error',
585583
'@typescript-eslint/no-restricted-types': 'error',
586-
'@typescript-eslint/no-shadow': 'error',
584+
'@typescript-eslint/no-shadow': 'off', // now in core
587585
'@typescript-eslint/no-this-alias': 'error',
588586
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
589587
'@typescript-eslint/no-unnecessary-condition': 'off', // TODO: temporary disable
@@ -605,7 +603,7 @@ export default tsConfig(
605603
'@typescript-eslint/no-unsafe-return': 'off', // TODO: consider
606604
'@typescript-eslint/no-unsafe-type-assertion': 'off', // TODO: consider
607605
'@typescript-eslint/no-unsafe-unary-minus': 'error',
608-
'@typescript-eslint/no-unused-expressions': 'error',
606+
'@typescript-eslint/no-unused-expressions': 'off', // now in core
609607
'@typescript-eslint/no-unused-vars': [
610608
'error',
611609
{
@@ -618,8 +616,8 @@ export default tsConfig(
618616
ignoreRestSiblings: true,
619617
},
620618
],
621-
'@typescript-eslint/no-use-before-define': 'off',
622-
'@typescript-eslint/no-useless-constructor': 'error',
619+
'@typescript-eslint/no-use-before-define': 'off', // now in core
620+
'@typescript-eslint/no-useless-constructor': 'off', // now in core
623621
'@typescript-eslint/no-useless-empty-export': 'error',
624622
'@typescript-eslint/no-wrapper-object-types': 'error',
625623
'@typescript-eslint/non-nullable-type-assertion-style': 'off', //TODO: temporarily disabled
@@ -673,26 +671,13 @@ export default tsConfig(
673671

674672
// Below list intentionally includes ESLint rules disabled above.
675673
// If any of the above rules are enabled in the future, they must still be disabled for TS files.
676-
'class-methods-use-this': 'off',
677674
'consistent-return': 'off',
678-
'default-param-last': 'off',
679675
'dot-notation': 'off',
680-
'init-declarations': 'off',
681-
'max-params': 'off',
682-
'no-array-constructor': 'off',
683-
'no-dupe-class-members': 'off',
684-
'no-empty-function': 'off',
685676
'no-implied-eval': 'off',
686-
'no-invalid-this': 'off',
687677
'no-loop-func': 'off',
688-
'no-magic-numbers': 'off',
689678
'no-redeclare': 'off',
690679
'no-restricted-imports': 'off',
691-
'no-shadow': 'off',
692-
'no-unused-expressions': 'off',
693680
'no-unused-vars': 'off',
694-
'no-use-before-define': 'off',
695-
'no-useless-constructor': 'off',
696681
'only-throw-error': 'off',
697682
'prefer-destructuring': 'off',
698683
'prefer-promise-reject-errors': 'off',
@@ -817,7 +802,10 @@ export default tsConfig(
817802
allowEmoji: true,
818803
},
819804
],
805+
'n/no-top-level-await': 'off',
820806
// TODO: remove when fetch/cpSync stabilizes across all node versions
807+
// fetch is not supported until Node.js 21.0.0
808+
// fs.cpSync is not supported until Node.js 22.3.0
821809
'n/no-unsupported-features/node-builtins': [
822810
'error',
823811
{

integrationTests/ts/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
"dependencies": {
99
"graphql": "file:../graphql.tgz",
1010
"graphql-esm": "file:../graphql-esm.tgz",
11-
"@types/node": "~24.0.10",
11+
"@types/node": "~24.0.14",
1212
"typescript-4.9": "npm:typescript@4.9.x",
1313
"typescript-5.0": "npm:typescript@5.0.x",
1414
"typescript-5.1": "npm:typescript@5.1.x",
1515
"typescript-5.2": "npm:typescript@5.2.x",
1616
"typescript-5.3": "npm:typescript@5.3.x",
1717
"typescript-5.4": "npm:typescript@5.4.x",
18-
"typescript-5.5": "npm:typescript@5.5.x"
18+
"typescript-5.5": "npm:typescript@5.5.x",
19+
"typescript-5.6": "npm:typescript@5.6.x",
20+
"typescript-5.7": "npm:typescript@5.7.x",
21+
"typescript-5.8": "npm:typescript@5.8.x"
1922
}
2023
}

0 commit comments

Comments
 (0)