Skip to content

compile errors when not including dom types #323

Closed
@DetachHead

Description

@DetachHead
// tsconfig.json
{
    "compilerOptions": {
        "lib": ["es2021"],
        "skipLibCheck": false
    },
    "include": ["**/*.ts"]
}
// main.ts
import { diff } from 'jsondiffpatch'
node_modules/jsondiffpatch/dist/index.d.ts:12:41 - error TS2304: Cannot find name 'Element'.
                                                                                            
12     showUnchanged(show: boolean, node?: Element | null, delay?: number): void;
                                           ~~~~~~~

node_modules/jsondiffpatch/dist/index.d.ts:19:26 - error TS2304: Cannot find name 'Element'.

19     hideUnchanged(node?: Element | null, delay?: number): void;
                            ~~~~~~~

since i'm using nodejs, i don't want dom types to be globaly available and i also don't want to have to suppress these errors with skipLibCheck.

upstream issue: microsoft/TypeScript#50424

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions