The code generated by npx @edgedb/generate edgeql-js causes TypeScript compilation errors if noUnusedLocals, noUnusedParameters, or exactOptionalPropertyTypes are enabled in tsconfig.json.
If all three are set to false, no errors occur.
(Note: The issue template fields below are mostly empty because I've tried to reduce this to a minimum reproducible example.)
Code
No application code other than this tsconfig.json (based on Astro's strictest.json):
❯ yarn tsc
yarn run v1.22.19
$ /tmp/edgedb-js-tsc-repro/node_modules/.bin/tsc
dbschema/edgeql-js/funcops.ts:318:3 - error TS2375: Type '{ kind: string | undefined; returnType: BaseType; cardinality: Cardinality; args: BaseTypeSet[]; namedArgs: { [key: string]: BaseTypeSet; }; }' is not assignable to type '{ kind?: string; returnType: BaseType; cardinality: Cardinality; args: BaseTypeSet[]; namedArgs: { [key: string]: BaseTypeSet; }; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'kind' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
318 return {
~~~~~~
dbschema/edgeql-js/funcops.ts:474:9 - error TS2375: Type '{ match: true; anytype: BaseType | undefined; }' is not assignable to type '{ match: boolean; anytype?: BaseType; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'anytype' are incompatible.
Type 'BaseType | undefined' is not assignable to type 'BaseType'.
Type 'undefined' is not assignable to type 'BaseType'.
474 return { match: true, anytype };
~~~~~~
dbschema/edgeql-js/modules/default.ts:3:1 - error TS6133: '$' is declared but its value is never read.
3 import * as $ from "../reflection";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbschema/edgeql-js/modules/math.ts:300:19 - error TS6133: 'P1' is declared but its value is never read.
300 type meanλFuncExpr<
~
301 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:305:20 - error TS6133: 'P1' is declared but its value is never read.
305 type meanλFuncExpr2<
~
306 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:341:21 - error TS6133: 'P1' is declared but its value is never read.
341 type stddevλFuncExpr<
~
342 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:346:22 - error TS6133: 'P1' is declared but its value is never read.
346 type stddevλFuncExpr2<
~
347 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:382:25 - error TS6133: 'P1' is declared but its value is never read.
382 type stddev_popλFuncExpr<
~
383 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:387:26 - error TS6133: 'P1' is declared but its value is never read.
387 type stddev_popλFuncExpr2<
~
388 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:423:51 - error TS6133: 'P1' is declared but its value is never read.
423 type var_0e9a1bf8ab9d5dc6830438e6ef6633feλFuncExpr<
~
424 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
425 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:428:52 - error TS6133: 'P1' is declared but its value is never read.
428 type var_0e9a1bf8ab9d5dc6830438e6ef6633feλFuncExpr2<
~
429 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
430 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:464:22 - error TS6133: 'P1' is declared but its value is never read.
464 type var_popλFuncExpr<
~
465 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/math.ts:469:23 - error TS6133: 'P1' is declared but its value is never read.
469 type var_popλFuncExpr2<
~
470 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
471 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:170:3 - error TS6133: 'NamedArgs' is declared but its value is never read.
170 NamedArgs extends {
~~~~~~~~~~~~~~~~~~~
171 "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172 },
~~~
dbschema/edgeql-js/modules/std.ts:219:3 - error TS6133: 'NamedArgs' is declared but its value is never read.
219 NamedArgs extends {
~~~~~~~~~~~~~~~~~~~
220 "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221 },
~~~
dbschema/edgeql-js/modules/std.ts:369:18 - error TS6133: 'P1' is declared but its value is never read.
369 type sumλFuncExpr<
~
370 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:374:19 - error TS6133: 'P1' is declared but its value is never read.
374 type sumλFuncExpr2<
~
375 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:379:19 - error TS6133: 'P1' is declared but its value is never read.
379 type sumλFuncExpr3<
~
380 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
381 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:424:20 - error TS6133: 'P1' is declared but its value is never read.
424 type countλFuncExpr<
~
425 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
426 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:946:18 - error TS6133: 'P1' is declared but its value is never read.
946 type allλFuncExpr<
~
947 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
948 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:973:18 - error TS6133: 'P1' is declared but its value is never read.
973 type anyλFuncExpr<
~
974 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
975 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2556:32 - error TS6133: 'P1' is declared but its value is never read.
2556 type json_array_unpackλFuncExpr<
~
2557 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2558 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2583:33 - error TS6133: 'P1' is declared but its value is never read.
2583 type json_object_unpackλFuncExpr<
~
2584 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2585 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2610:31 - error TS6133: 'P1' is declared but its value is never read.
2610 type json_object_packλFuncExpr<
~
2611 P1 extends $.TypeSet<$.TupleType<[$str, $json]>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2612 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2747:27 - error TS6133: 'P1' is declared but its value is never read.
2747 type range_unpackλFuncExpr<
~
2748 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2749 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2752:28 - error TS6133: 'P1' is declared but its value is never read.
2752 type range_unpackλFuncExpr2<
~
2753 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2754 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2757:28 - error TS6133: 'P1' is declared but its value is never read.
2757 type range_unpackλFuncExpr3<
~
2758 P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2759 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2762:28 - error TS6205: All type parameters are unused.
2762 type range_unpackλFuncExpr4<
~
2763 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2764 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2765 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2768:28 - error TS6205: All type parameters are unused.
2768 type range_unpackλFuncExpr5<
~
2769 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2770 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2771 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2774:28 - error TS6205: All type parameters are unused.
2774 type range_unpackλFuncExpr6<
~
2775 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2776 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2777 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2780:28 - error TS6205: All type parameters are unused.
2780 type range_unpackλFuncExpr7<
~
2781 P1 extends $.TypeSet<$.RangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2782 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2783 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2786:28 - error TS6205: All type parameters are unused.
2786 type range_unpackλFuncExpr8<
~
2787 P1 extends $.TypeSet<$.RangeType<$datetime>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2788 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2789 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2792:28 - error TS6205: All type parameters are unused.
2792 type range_unpackλFuncExpr9<
~
2793 P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2794 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2795 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2798:29 - error TS6205: All type parameters are unused.
2798 type range_unpackλFuncExpr10<
~
2799 P1 extends $.TypeSet<$.RangeType<$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2800 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2801 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2804:29 - error TS6205: All type parameters are unused.
2804 type range_unpackλFuncExpr11<
~
2805 P1 extends $.TypeSet<$.RangeType<_cal.$local_datetimeλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2806 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2807 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:2935:27 - error TS6205: All type parameters are unused.
2935 type re_match_allλFuncExpr<
~
2936 P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2937 P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2938 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3862:32 - error TS6133: 'P1' is declared but its value is never read.
3862 type multirange_unpackλFuncExpr<
~
3863 P1 extends $.TypeSet<$.MultiRangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3864 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3867:33 - error TS6133: 'P1' is declared but its value is never read.
3867 type multirange_unpackλFuncExpr2<
~
3868 P1 extends $.TypeSet<$.MultiRangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3869 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3872:33 - error TS6133: 'P1' is declared but its value is never read.
3872 type multirange_unpackλFuncExpr3<
~
3873 P1 extends $.TypeSet<$.MultiRangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3874 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3877:33 - error TS6133: 'P1' is declared but its value is never read.
3877 type multirange_unpackλFuncExpr4<
~
3878 P1 extends $.TypeSet<$.MultiRangeType<$number>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3879 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3882:33 - error TS6133: 'P1' is declared but its value is never read.
3882 type multirange_unpackλFuncExpr5<
~
3883 P1 extends $.TypeSet<$.MultiRangeType<$decimalλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3884 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3887:33 - error TS6133: 'P1' is declared but its value is never read.
3887 type multirange_unpackλFuncExpr6<
~
3888 P1 extends $.TypeSet<$.MultiRangeType<$datetime>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3889 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3892:33 - error TS6133: 'P1' is declared but its value is never read.
3892 type multirange_unpackλFuncExpr7<
~
3893 P1 extends $.TypeSet<$.MultiRangeType<_cal.$local_datetimeλICastableTo>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3894 > = $.$expr_Function<
~
dbschema/edgeql-js/modules/std.ts:3897:33 - error TS6133: 'P1' is declared but its value is never read.
3897 type multirange_unpackλFuncExpr8<
~
3898 P1 extends $.TypeSet<$.MultiRangeType<_cal.$local_date>>,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3899 > = $.$expr_Function<
~
dbschema/edgeql-js/path.ts:232:3 - error TS6133: 'exclusive' is declared but its value is never read.
232 exclusive: Exclusive,
~~~~~~~~~
Found 45 errors in 5 files.
Errors Files
2 dbschema/edgeql-js/funcops.ts:318
1 dbschema/edgeql-js/modules/default.ts:3
10 dbschema/edgeql-js/modules/math.ts:300
31 dbschema/edgeql-js/modules/std.ts:170
1 dbschema/edgeql-js/path.ts:232
error Command failed with exit code 2.
The code generated by
npx @edgedb/generate edgeql-js
causes TypeScript compilation errors ifnoUnusedLocals
,noUnusedParameters
, orexactOptionalPropertyTypes
are enabled intsconfig.json
.If all three are set to
false
, no errors occur.(Note: The issue template fields below are mostly empty because I've tried to reduce this to a minimum reproducible example.)
Code
No application code other than this
tsconfig.json
(based on Astro'sstrictest.json
):Schema
Error or desired behavior
Running
tsc
produces the following errors:Versions:
edgedb-js
version: 1.5.7@edgedb/generate
version: v0.5.3