Jump to content
Search Community

Typescript eslint question

TTLuna test
Moderator Tag

Recommended Posts

Hello,

I install gsap in my project, and get some "Observer" eslint erros like

ERROR in /Users/test/node_modules/gsap/types/scroll-trigger.d.ts(301,75):
301:75 Cannot find name 'Observer'.
300 | */
> 301 | static normalizeScroll(enable?: boolean | ScrollTrigger.NormalizeVars | Observer): Observer | null;
302 |
303 | /**
304 | * Returns the Observer instance that is currently normalizing scroll behavior (if one exists).
ERROR in /Users/test/node_modules/gsap/types/scroll-trigger.d.ts(301,86):
301:86 Cannot find name 'Observer'.
300 | */
> 301 | static normalizeScroll(enable?: boolean | ScrollTrigger.NormalizeVars | Observer): Observer | null;
302 |
303 | /**
304 | * Returns the Observer instance that is currently normalizing scroll behavior (if one exists).

I have to add reference below to the file "/node_modules/gsap/types/index.d.ts" and the error is gone.

/// <reference path="observer.d.ts"/>
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...