Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .eslintrc.js

This file was deleted.

5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{}
{
"arrowParens": "avoid",
"trailingComma": "none"
}
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,20 @@ Conventions:
transpiled `.ts` files under their `.js` URL.
- Only erasable TypeScript syntax is allowed (`erasableSyntaxOnly`): no enums,
namespaces or parameter properties. Type-stripping must never change
runtime behavior.
runtime behavior. Class fields must use the `declare` modifier (type-only);
a bare initialized field would require babel's class-properties transform,
which changes own-property layout and is deliberately not enabled.
- Explicit `any` and `@ts-ignore` are banned repo-wide, enforced by
`npm run lint-no-any` (oxlint) in the lint script. Use `unknown` plus
narrowing; a documented `as unknown as T` is the escape hatch of last
resort at genuine dynamic boundaries.
- The internal type system lives in `src/types.ts`. Plugin modules declare
the members they add via `declare module "../types.js"` interface
augmentation inside their own file.
- Specs are TypeScript too, type-checked by `test/tsconfig.json` (part of
`npm run typecheck`). Spec globals are ambient-declared in
`test/globals.d.ts`; the Node run strips types via `@babel/register`
(see `test/deployment/node/registerTypeScript.js`).
- `src/libs/fflate.js`, `src/libs/fast-png.js`, `src/license.js` and
`src/polyfills.js` intentionally stay JavaScript.
- `src/libs/WebPDecoder.ts` and `src/libs/ttffont.ts` are vendored/generated
Expand Down
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function uniq(a) {
var prims = { boolean: {}, number: {}, string: {} },
objs = [];

return a.filter(function(item) {
return a.filter(function (item) {
var type = typeof item;
if (type in prims)
if (Object.prototype.hasOwnProperty.call(prims[type], item)) {
Expand Down
4 changes: 2 additions & 2 deletions examples/MathJax/MathJax_Main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/MathJax/MathJax_Math-italic.js

Large diffs are not rendered by default.

Loading