Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds strict type-checking to all files in the
lib
directory.plugin:import/typescript
was added because importingtypes.d.ts
displayed an error.%example-css-src%
was removed from the JS editor, because none of the interactive examples uses it and it doesn't really make sense for this editor to have the ability to add CSS per example.{type}
syntax from the docs, because it is no longer needed and in some cases stated types were incorrect.${page.type}
to${page}
inheight-builder.ts
becausepage.type
is of the type never at this point.stats.hasWarnings()
tostats.warnings
in mdn-bob, becausehasWarnings()
didn't really provide type safety.build
was changed a bit. I extracted most of the behavior tofillPageTemplate
so we don't repeatoutputFileSync
multiple times. Casescss
andjs
were separated becausejs
editor doesn't supportjsExampleSrc
orcssExampleSrc
options.getPageTmpl
I have removed try/catch, so the result is never undefined. A possible error will be caught in the build function anyway.processExampleCode
was split into justprocessJsExample
andgetExampleCode
, because thehtml
case was never used. The functionhandleDeprecatedJSExampleFormat
is actually never used too, but I will remove it in a separate PR../types/types.d.ts
can now be used by YARI, so we can importheight-data
related interfaces.