Skip to content

build: Enable TypeScript type checking#7680

Open
camdecoster wants to merge 56 commits into
masterfrom
cam/7678/enable-typescript-type-checking
Open

build: Enable TypeScript type checking#7680
camdecoster wants to merge 56 commits into
masterfrom
cam/7678/enable-typescript-type-checking

Conversation

@camdecoster
Copy link
Copy Markdown
Contributor

@camdecoster camdecoster commented Jan 2, 2026

Description

Enable TypeScript type checking.

Closes #7678.

Changes

  • Add set of plotly.js types
  • Enable type checking
  • Update some files to TypeScript
  • Use ts-node for running some scripts
  • Add type generation script that uses attributes files schema
  • Add type checking steps to CI

Testing

  • CI should cover everything
  • Run npm run build locally to check that everything is bundled properly by esbuild
  • Run npm run schema to recreate the generated types
  • Run plotly.js devtools and load some mocks to make sure everything is working correctly
  • Run npm run typecheck to perform a type check on the source code. There should be no errors:
    $ npm run typecheck
    
    > plotly.js@3.5.1 typecheck
    > tsc --noEmit
    $

Notes

  • This PR adds the TypeScript compiler and typechecking via npm script
  • The provided types are a combination of plotly.js types from DefinitelyTyped and the schema (with Claude combining the two). This is a first pass and the types will need to be updated as files are converted.
  • Most of the types are now built straight from the schema
  • (Most) IDEs will read the types and provide autocompletion once files are converted over
  • Read the README in src/types for an overview of how the types are set up
  • esbuild is compatible with TypeScript already, but it doesn't do type checking. To check types you need to run npm run typecheck. VS Code will also provide feedback as you're editing files.
  • I converted a few simple files to TypeScript as an example. I opted to use ESM syntax for these files which necessitated some changes in the require statements for the converted files. This is due to how esbuild determines if a default import should be namespaced or not.
  • Some of the converted files are used in scripts not processed by esbuild. Node 18 doesn't handle TS files natively, so these scripts need to be run with ts-node, a "TypeScript execution and REPL for node.js".
  • The TS config is pretty lenient right now to make it easier to convert things piece by piece. Once we make enough progress, this can be tightened up.
  • TS is not emitting files/types right now. esbuild handles converting the TS so the TS compiler won't need to do that. It would be valuable to have the compiler write the type definition files in the future.
  • There's an entry point for types now. It points to the public types, which are a subset of all types. In the future, there could be a type build step that compiles them down to a flat file.

@camdecoster camdecoster changed the title build: Enable typescript type checking build: Enable TypeScript type checking Jan 2, 2026
@camdecoster camdecoster marked this pull request as ready for review January 2, 2026 23:54
@camdecoster camdecoster requested a review from emilykl January 7, 2026 16:57
var constants = require('./constants');
var overrideAll = require('../../plot_api/edit_types').overrideAll;
var sortObjectKeys = require('../../lib/sort_object_keys');
var sortObjectKeys = require('../../lib/sort_object_keys').default;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camdecoster Is it worth considering moving away from default exports entirely as part of this transition?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only matters when one mixes CJS and ESM. That said, I don't think that we can avoid that for a long time. I suppose we could make just pick a direction to go and standardize. I could go either way, but the esbuild docs make it clear that they don't like default exports.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue that covers converting from CJS to ESM in #7119. I left a comment mentioning your suggestion.

Comment thread src/types/core/data.d.ts Outdated
fillcolor?: string;
line?: Partial<Line>;
marker?: Partial<Marker>;
mode?: 'lines' | 'markers' | 'lines+markers' | 'none' | 'text' | 'lines+text' | 'markers+text' | 'lines+markers+text';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does TypeScript have any support for 'flag list'-type string values such as this, where the string may consist of any number of a fixed set of values joined by a delimiter? I suppose not as it's fairly custom.

Otherwise could we use a custom type or a custom function to generate these lists of allowed values based on the flags?

Copy link
Copy Markdown
Contributor Author

@camdecoster camdecoster Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's called a union type. What's shown on 133 is an example of that (though it's only used on that line). If we needed that type elsewhere, we could define it separately and reference it within the ScatterTrace type like this:

type Mode = 'lines' | 'markers' | 'lines+markers' | 'none' | 'text' | 'lines+text' | 'markers+text' | 'lines+markers+text';

export interface ScatterTrace extends TraceBase {
    ...,
    mode: Mode;
    ...,
}

Copy link
Copy Markdown
Contributor

@emilykl emilykl Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I guess I'm imagining something like a helper function which looks like flagList(flaglistVals, otherVals) such that

flaglistVals(['lines', 'markers', 'text'], ['none'])

returns

'lines' | 'markers' | 'lines+markers' | 'none' | 'text' | 'lines+text' | 'markers+text' | 'lines+markers+text';`

Comment thread src/types/core/data.d.ts Outdated
* Use specific trace types when available
*/
export interface GenericTrace extends TraceBase {
x?: any[];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there are any traces where x/y/z are allowed to be a type other than number[] | string[] but I could be wrong about that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why it's permissive here. Once we become sure, we can change this as you suggest.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case maybe it would be easier to start stricter and loosen if needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, scratch that

@emilykl
Copy link
Copy Markdown
Contributor

emilykl commented Jan 15, 2026

@camdecoster Can you add a type-check step to the CI?

Comment thread src/types/core/layout.d.ts Outdated
yaxis?: Partial<LayoutAxis>;

// Multiple axes support (xaxis2, yaxis3, etc.)
[key: string]: any;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we tighten this layout spec here to match the plot schema?

@emilykl
Copy link
Copy Markdown
Contributor

emilykl commented Jan 15, 2026

@camdecoster Some initial thoughts on organization of the types:

For types corresponding directly to the schema:

  • Group them all under a single directory (e.g. types/core/schema/), maybe even in a single file if not too unwieldy
  • Use nested types where useful for repeated patterns (e.g. font options); these should use some kind of consistent naming scheme

Copy link
Copy Markdown

@codeCraft-Ritik codeCraft-Ritik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! The implementation is clean and easy to understand

@camdecoster camdecoster assigned camdecoster and unassigned emilykl Apr 15, 2026
@camdecoster camdecoster force-pushed the cam/7678/enable-typescript-type-checking branch from 2439dad to de168ca Compare May 6, 2026 22:07
@camdecoster camdecoster requested a review from emilykl May 7, 2026 16:07
Comment on lines +57 to +69
### 3. Fix array literals and string literals

Anywhere an attribute uses a literal-array of options, add `as const`:

```ts
// Before
values: ['v', 'h'],

// After
values: ['v', 'h'] as const,
```

Without this, TypeScript widens to `string[]` and you lose the union.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this step still required now that the types are not generated directly from the attributes?

Comment on lines +87 to +97
### 5. Verify the schema generator covers the type

Consumer-facing types for traces and layout components are generated from
`plot-schema.json` by `tasks/generate_schema_types.mjs`. After converting
an `attributes.ts` file, verify the corresponding type already exists in
`src/types/generated/schema.d.ts`. If it does, no further action is needed
for the type — the conversion's main value is type-checking the source.

If the schema-generated type is missing properties that the hand-written
type had, those properties are likely runtime-only internal state and
should be added to the corresponding `Full*` interface instead.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step isn't needed anymore either, right?

Maybe could be replaced with something like "If you did everything right above, the plot schema should not change. Run npm run schema and verify that there are no changes to the file test/plot-schema.json."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I guess that part is already covered by the next step.

- `.default` added to `require('./attributes')` in `index.js` and `defaults.js`

Note: Consumer-facing types for modebar (and all other layout components)
are now generated from `plot-schema.json` by `tasks/generate_schema_types.mjs`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
are now generated from `plot-schema.json` by `tasks/generate_schema_types.mjs`,
are generated from `plot-schema.json` by `tasks/generate_schema_types.mjs`,

Comment on lines +142 to +144

Schema output verified byte-identical (2547 bytes) before and after the
conversion.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Schema output verified byte-identical (2547 bytes) before and after the
conversion.

Comment on lines +146 to +156
## What stays hand-written

The schema does not describe these — they remain in `src/types/`:

- **Events** (`PlotMouseEvent`, `LegendClickEvent`, etc.)
- **Public API function signatures** (`Plotly.newPlot`, `relayout`, ...)
- **Internal types** (`FullLayout._modules`, `GraphDiv._fullData`, ...)
- **Utility types** (`Color`, `Datum`, `TypedArray`, `MarkerSymbol`, etc.) —
these are the primitives the generator's emitted types reference.

If you find yourself converting one of these, stop and ask.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate of What's hand-written and stays that way in ARCHITECTURE.md and doesn't really make sense here anymore.

Suggested change
## What stays hand-written
The schema does not describe these — they remain in `src/types/`:
- **Events** (`PlotMouseEvent`, `LegendClickEvent`, etc.)
- **Public API function signatures** (`Plotly.newPlot`, `relayout`, ...)
- **Internal types** (`FullLayout._modules`, `GraphDiv._fullData`, ...)
- **Utility types** (`Color`, `Datum`, `TypedArray`, `MarkerSymbol`, etc.) —
these are the primitives the generator's emitted types reference.
If you find yourself converting one of these, stop and ask.


## Schema-generated types

All 49 trace data interfaces, layout component interfaces, and the Layout
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
All 49 trace data interfaces, layout component interfaces, and the Layout
All trace data interfaces, layout component interfaces, and the Layout

Comment on lines +186 to +189

Converting an `attributes.js` file to TypeScript is still valuable because
it type-checks the source definitions against `AttributeMap`, catching
typos and structural errors at compile time.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate of lines 139-141 above

Suggested change
Converting an `attributes.js` file to TypeScript is still valuable because
it type-checks the source definitions against `AttributeMap`, catching
typos and structural errors at compile time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the attributes files aren't directly contributing to the type generation anymore, this file could probably be made more concise. Not blocking for merge though.

Comment thread src/types/GENERATOR.md
- Common enum aliases (Calendar, Dash, AxisType, PatternShape, XRef, YRef,
TransitionEasing, PlotType)
- Shared sub-interfaces (Font, ColorBar, HoverLabel, etc.)
- 49 per-trace data interfaces (BarData, ScatterData, IndicatorData, ...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 49 per-trace data interfaces (BarData, ScatterData, IndicatorData, ...)
- Data interfaces for each trace type (BarData, ScatterData, IndicatorData, etc.)

Comment on lines +31 to +32
// PascalCase type name and a `match(key, path, values)` predicate. The first
// enumerated attribute whose match returns true defines the alias's values.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// PascalCase type name and a `match(key, path, values)` predicate. The first
// enumerated attribute whose match returns true defines the alias's values.
// PascalCase type name and a `match(key, path, values)` predicate. If multiple
// enumerated attributes match the predicate, the one with the largest set of values
// is chosen.

Comment thread src/types/GENERATOR.md
Comment on lines +62 to +63
Containers that appear at least `MIN_OCCURRENCES` (= 5) times AND have at
least `MIN_PROPERTIES` (= 4) properties become shared interfaces (Font,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Containers that appear at least `MIN_OCCURRENCES` (= 5) times AND have at
least `MIN_PROPERTIES` (= 4) properties become shared interfaces (Font,
Containers that appear at least `MIN_OCCURRENCES` times AND have at
least `MIN_PROPERTIES` properties become shared interfaces (Font,

Comment thread src/types/GENERATOR.md
Comment on lines +198 to +199

Regenerate with `npm run schema`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Regenerate with `npm run schema`.

Comment thread src/types/GENERATOR.md
Comment on lines +325 to +329
The wildcard is load-bearing: it removes the maintenance burden of keeping
`lib/index.d.ts` in sync with new schema additions. If anyone ever swaps
it for an explicit allowlist, restore the per-name re-export verifier
that previously lived in `tasks/schema.mjs` (see git history) — otherwise
new generated types will silently fail to surface in the public API.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this paragraph needed? I don't think it's likely someone would decide to remove the wildcard.

Suggested change
The wildcard is load-bearing: it removes the maintenance burden of keeping
`lib/index.d.ts` in sync with new schema additions. If anyone ever swaps
it for an explicit allowlist, restore the per-name re-export verifier
that previously lived in `tasks/schema.mjs` (see git history) — otherwise
new generated types will silently fail to surface in the public API.

Comment thread src/types/GENERATOR.md
Comment on lines +335 to +338
`git diff --exit-code`. If either differs, exit code 1 — meaning either a
developer changed the source schema but didn't commit the regenerated
artifacts, or an attribute-file conversion silently altered the runtime
schema and the change wasn't intentionally committed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`git diff --exit-code`. If either differs, exit code 1 — meaning either a
developer changed the source schema but didn't commit the regenerated
artifacts, or an attribute-file conversion silently altered the runtime
schema and the change wasn't intentionally committed.
`git diff --exit-code`. If either differs, the command fails with exit code 1
and outputs the diff to the console.

Comment thread src/types/README.md
- TypeScript build infrastructure: ✅ done
- Public type surface in `src/types/`: ✅ done
- `AttributeMap` validation machinery: ✅ done
- **Schema-based type generator**: ✅ done — all 49 trace types + layout + shared interfaces
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Schema-based type generator**: ✅ done — all 49 trace types + layout + shared interfaces
- **Schema-based type generator**: ✅ done — all trace types + layout + shared interfaces

Comment thread src/types/README.md
- CI gates (`typecheck` + `schema-typegen-diff-check`): ✅ done
- First attribute file converted (modebar): ✅ done
- Conversion of remaining component attribute files: 🚧 in progress

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the .js files in the repo which are not attributes files should also ideally be converted eventually, right? Add that to the list?

Comment thread src/types/README.md

- Common enum aliases (Calendar, Dash, AxisType, PatternShape, XRef, YRef,
TransitionEasing, PlotType)
- All 49 per-trace data interfaces (BarData, ScatterData, IndicatorData, ...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- All 49 per-trace data interfaces (BarData, ScatterData, IndicatorData, ...)
- Data interfaces for each trace type (BarData, ScatterData, IndicatorData, etc.)

Comment thread src/types/SETUP.md
Quick reference for the TypeScript toolchain in plotly.js.

## What's installed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following dev dependencies are used for maintaining plotly.js types:

Comment thread src/types/SETUP.md
Comment on lines +7 to +10
- **TypeScript** (`typescript ^5.9.3`) — type checker only, never emits JS
- **ts-node** (`^10.9.2`) — runs TS scripts directly (build helpers)
- **@types/node**, **@types/d3** — third-party type definitions
- esbuild handles `.ts` natively for bundling — no plugins needed
Copy link
Copy Markdown
Contributor

@emilykl emilykl Jun 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **TypeScript** (`typescript ^5.9.3`) — type checker only, never emits JS
- **ts-node** (`^10.9.2`) — runs TS scripts directly (build helpers)
- **@types/node**, **@types/d3** — third-party type definitions
- esbuild handles `.ts` natively for bundling — no plugins needed
- `typescript` — used for type-checking only
- `ts-node` — used for running TS scripts (build helpers)
- `@types/node`, `@types/d3` — provide third-party type definitions
Note: esbuild handles `.ts` files natively for bundling, so no extra plugins are needed for the bundling process.
`tsconfig.json` sets `noEmit: true` so that tsc never writes files. esbuild is the build system; tsc is the verifier.

Comment thread src/types/SETUP.md
Comment on lines +12 to +19
## Two tools, two jobs

| Tool | Job |
|---|---|
| **esbuild** | Bundle for production. Strips types, transpiles to ES2016, emits `dist/plotly.js`. Fast (~450ms full build). Does **not** check types. |
| **tsc** | Type-check only. Reads `.ts` and `.js` (with `allowJs: true`), reports errors, no output. Slower (~2-5s) but catches bugs. |

`tsconfig.json` sets `noEmit: true` so tsc never writes files. esbuild is the build system; tsc is the verifier.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Two tools, two jobs
| Tool | Job |
|---|---|
| **esbuild** | Bundle for production. Strips types, transpiles to ES2016, emits `dist/plotly.js`. Fast (~450ms full build). Does **not** check types. |
| **tsc** | Type-check only. Reads `.ts` and `.js` (with `allowJs: true`), reports errors, no output. Slower (~2-5s) but catches bugs. |
`tsconfig.json` sets `noEmit: true` so tsc never writes files. esbuild is the build system; tsc is the verifier.

Comment thread src/types/SETUP.md
npm run typecheck # tsc --noEmit, errors reported, no output
npm run typecheck-watch # incremental rechecking on change

npm run schema # rebuild test/plot-schema.json + regenerate types
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm run schema # rebuild test/plot-schema.json + regenerate types
npm run schema # rebuild test/plot-schema.json + regenerate types under src/types/generated/

Comment thread src/types/SETUP.md
npm run typecheck-watch # incremental rechecking on change

npm run schema # rebuild test/plot-schema.json + regenerate types
npm run schema-typegen-diff-check # regenerate + verify no uncommitted drift in test/plot-schema.json or schema.d.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm run schema-typegen-diff-check # regenerate + verify no uncommitted drift in test/plot-schema.json or schema.d.ts
npm run schema-typegen-diff-check # regenerate + verify no changes to test/plot-schema.json or src/types/generated/schema.d.ts

Comment thread src/types/SETUP.md
Comment on lines +36 to +37
npm run bundle # esbuild → dist/plotly.js
npm run build # full production build
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm run bundle # esbuild → dist/plotly.js
npm run build # full production build
npm run build # full production build (regenerate all files under `dist/`)

Comment thread src/types/SETUP.md
Comment on lines +80 to +88
## Performance

For a codebase of ~750 source files:

| Operation | Time |
|---|---|
| `tsc --noEmit` cold | ~2-5s |
| `tsc --noEmit --watch` incremental | ~100ms |
| esbuild full bundle | ~450ms |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this section is needed in SETUP.md.

Suggested change
## Performance
For a codebase of ~750 source files:
| Operation | Time |
|---|---|
| `tsc --noEmit` cold | ~2-5s |
| `tsc --noEmit --watch` incremental | ~100ms |
| esbuild full bundle | ~450ms |

Comment thread tasks/schema.mjs
Comment on lines +75 to +82
// generate TypeScript types from the schema — traces, layout, common enum
// aliases, animation/frame/config interfaces, and an `_internal` namespace.
//
// New schema-derived types automatically reach `plotly.js` consumers because
// `lib/index.d.ts` uses `export type * from '../src/types/generated/schema'`.
// If you ever swap that wildcard for an explicit allowlist, restore the
// per-name re-export verifier that lived here (see git history) — otherwise
// new types will silently fail to surface in the public API.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// generate TypeScript types from the schema — traces, layout, common enum
// aliases, animation/frame/config interfaces, and an `_internal` namespace.
//
// New schema-derived types automatically reach `plotly.js` consumers because
// `lib/index.d.ts` uses `export type * from '../src/types/generated/schema'`.
// If you ever swap that wildcard for an explicit allowlist, restore the
// per-name re-export verifier that lived here (see git history) — otherwise
// new types will silently fail to surface in the public API.
// generate TypeScript types from the schema
// and write to `src/types/generated/schema.d.ts`

Comment thread tsconfig.json
"outDir": "./dist",
"noEmit": true,

// Type checking - start strict, loosen if necessary
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Type checking - start strict, loosen if necessary

Comment thread tsconfig.json
"declaration": false,
"declarationMap": false,
"sourceMap": true,
"outDir": "./dist",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed if there's no output?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh never mind, I guess this config file is used by esbuild as well?

}

// PlotType — derived from the list of trace names, not from an attribute.
found.set('PlotType', { values: Object.keys(schema.traces).sort() });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should be called TraceType... the question is, is it worth breaking correspondence with DefinitelyTyped to use the semantically correct type name?

@emilykl
Copy link
Copy Markdown
Contributor

emilykl commented Jun 4, 2026

@camdecoster I think it would be useful to add guidance for converting non-attributes files as well, or at least guidance on which files are the highest-priority to convert and which ones don't need to be touched. But again that doesn't need to be blocking for merge.

Copy link
Copy Markdown
Contributor

@emilykl emilykl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a bunch of nitpicky comments but big picture LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add TypeScript type checking

3 participants