From 0f1e2a17226885d2fc58fbb84ad0599d5de774c0 Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Wed, 4 May 2022 10:28:05 +0800 Subject: [PATCH] docs: add file header Also: - test: clarify test --- tests/lib/espree.js | 15 ++++++++++++++- tools/js-for-ts.js | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/lib/espree.js b/tests/lib/espree.js index 15f12ce8..487e8761 100644 --- a/tests/lib/espree.js +++ b/tests/lib/espree.js @@ -1,9 +1,22 @@ +/** + * @fileoverview Tests for EspreeParser. + * @author Brett Zamir + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + import assert from "assert"; import * as acorn from "acorn"; import espree from "../../lib/espree.js"; +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + describe("espree", () => { - it("Throws upon `jsx_readString` when not using JSX", () => { + it("Throws upon `jsx_readString` call when not using JSX", () => { const espreeParserFactory = espree(); const AcornParser = acorn.Parser; const EspreeParser = espreeParserFactory(/** @type {EspreeParser} */ (AcornParser)); diff --git a/tools/js-for-ts.js b/tools/js-for-ts.js index ba30fdae..02ade3b2 100644 --- a/tools/js-for-ts.js +++ b/tools/js-for-ts.js @@ -1,5 +1,20 @@ +/** + * @fileoverview Tool to prepare JavaScript (+JSDoc) for TypeScript, inlining + * `@local`-marked `@typedef`'s, and building a faux class for `@export`-marked + * classes so the type can be exported out of a given file. + * @author Brett Zamir + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + import js2tsAssistant from "@es-joy/js2ts-assistant"; +// ---------------------------------------------------------------------------- +// Modify output +// ---------------------------------------------------------------------------- + await js2tsAssistant({ customClassHandling({ ast, builders, superClassName