yousoumar Posted January 23, 2022 Posted January 23, 2022 Hi guys ! I installed @types/greensock and started using Gsap with TypeScript. Everything works fine, but the ScrollTo plugin is giving this eslint error (image attached). Someone knows something about it ? At least I want to be able to tell eslint to ignore this error. Thank you ! import { ScrollToPlugin } from "gsap/ScrollToPlugin"; import { gsap } from "gsap"; gsap.registerPlugin(ScrollToPlugin); export const headerInteractionHandler = () => { document.querySelector("header .logo").addEventListener("click", (e) => { e.preventDefault(); let element = <HTMLAnchorElement>e.currentTarget; gsap.to(window, { duration: 0.8, scrollTo: `${element.getAttribute("data-destination")}`, }); }); };
Solution GreenSock Posted January 23, 2022 Solution Posted January 23, 2022 You definitely shouldn’t be using the @types/greensock package - that was never from GreenSock (someone else made it) and it hasn’t been updated in 5+ years. The GSAP package itself comes with TypeScript definition files so you shouldn’t need to install anything else. 1
yousoumar Posted January 23, 2022 Author Posted January 23, 2022 41 minutes ago, GreenSock said: You definitely shouldn’t be using the @types/greensock package - that was never from GreenSock (someone else made it) and it hasn’t been updated in 5+ years. The GSAP package itself comes with TypeScript definition files so you shouldn’t need to install anything else. Thanks for pointing out. I didn't know. I deleted it, changed my .eslitnrc parser to @typescript-eslint/parserand the error is gone. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now