Releases: val-town/codemirror-ts
Improved tree-shakeability
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.