From f66c4e727368da794f4ded115990ce7accbcc08a Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Fri, 29 May 2020 16:22:07 +0100 Subject: [PATCH] Add type definitions for acorn.mjs (#954) For TypeScript projects that use the acorn.mjs distribution bundle, a separate `.mjs.d.ts` needs to be added to the folder. This was suggested in https://github.com/microsoft/TypeScript/issues/27957#issuecomment-623631119. --- .gitignore | 4 +++- acorn/dist/acorn.mjs.d.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 acorn/dist/acorn.mjs.d.ts diff --git a/.gitignore b/.gitignore index 1052d7d8a..983986903 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,9 @@ /.tern-port /local /bin/_acorn.js -/acorn/dist +/acorn/dist/* /acorn-loose/dist /acorn-walk/dist /yarn.lock +!/acorn/dist/acorn.d.ts +!/acorn/dist/acorn.mjs.d.ts \ No newline at end of file diff --git a/acorn/dist/acorn.mjs.d.ts b/acorn/dist/acorn.mjs.d.ts new file mode 100644 index 000000000..5f633595e --- /dev/null +++ b/acorn/dist/acorn.mjs.d.ts @@ -0,0 +1,2 @@ +import * as acorn from "./acorn"; +export = acorn; \ No newline at end of file