Releases: val-town/codemirror-ts
Flexible log method
Worker only & new twoslash
There are two big changes in this release:
- We're dropping the non-worker versions of all extensions. They were always just something for demos and were never recommended in prod. Supporting two slightly-different versions of every API was not long-term sustainable.
- Support for twoslash. See the demo for an example: you type a comment like
// ^?
and it'll show you what the type of the thing pointed at by^
is.
Improved tree-shakeability
The only change in this release is adding a sideEffects
key to package.json, which should make this module more tree-shakeable for bundlers that support that.
Adds diagnosticCodesToIgnore for tsLinter
This new option lets you ignore expected lint errors by listing their error codes.
Example:
tsLinter({
diagnosticCodesToIgnore: [
2354, // tslib not found
2307, // Cannot find module 'xxx' or its corresponding type declarations
1375, // 'await' expressions are only allowed at the top level of a file when that file is a module
],
}),
Thanks @KABBOUCHI for this contribution!
Fixes compatibility with bundlers
This module is published as ESM, and imports from the TypeScript module. It previously used named imports from TypeScript, but the TypeScript module doesn't expose named imports. Some bundlers create compatibility for this, basically importing the default and destructuring from it. But others don't. This update just uses the default import to ensure compatibility across bundlers.
Add getEnv method
v2.0.0
BREAKING CHANGE: if you use 1.0.0, you'll definitely have to update code.
I realized that this module wasn't doing things right! And it was good to fix it. The right way to manage configuration in CodeMirror is with a Facet, not with passing parameters!
So before, something like lint was
tsLinter({ env, path });
But in 2.0.0, you use it like
tsLinter();
And you need a new thing, the facet!
tsFacet.of({ env, path });
You need that in your extensions list - that's where the other extensions get their configuration from.