Fix TS error with twemoji typings without dom lib
Including the dom lib doesn't make much sense since we're not in a browser environment. While this solution isn't perfect either, I think it's more fitting.
This commit is contained in:
parent
c4d6556fe4
commit
6d6bc735e9
2 changed files with 9 additions and 2 deletions
|
@ -66,6 +66,14 @@ import fs from "fs";
|
|||
import sharp from "sharp";
|
||||
import twemoji from "twemoji";
|
||||
|
||||
declare global {
|
||||
// This is here so TypeScript doesn't give an error when importing twemoji
|
||||
// since one of the signatures of twemoji.parse() takes an HTMLElement but
|
||||
// we're not in a browser environment so including the DOM lib would not make
|
||||
// sense
|
||||
type HTMLElement = unknown;
|
||||
}
|
||||
|
||||
import { Url, URL, URLSearchParams } from "url";
|
||||
const ConfigSchema = t.type({
|
||||
can_roles: t.boolean,
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
"emitDecoratorMetadata": true,
|
||||
"target": "es2018",
|
||||
"lib": [
|
||||
"esnext",
|
||||
"DOM"
|
||||
"esnext"
|
||||
],
|
||||
"baseUrl": ".",
|
||||
"resolveJsonModule": true,
|
||||
|
|
Loading…
Add table
Reference in a new issue