Context: I'm creating a project using React, and I bought a theme to help me with the visuals and animations. The theme is for React and Next.js, but I'm not using Next.js, only React. The animations are done using JavaScript files from GSAP. Following the theme instructions, I was able to set everything up and imported the JavaScript files from my folder:
import ScrollSmoother from "../../gsap-plugins/ScrollSmoother.min.js";
And I was able to have the animations running, but then this problem came up when I try to use npm run build
I get an error coming from the animation files.
[eslint]
src\gsap-plugins\ScrollSmoother.min.js
Line 11:1: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:107: 'define' is not defined no-undef
Line 11:118: 'define' is not defined no-undef
Line 11:148: Unexpected use of 'self' no-restricted-globals
Line 11:277: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:1301: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:1558: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:1663: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:1972: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:2185: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:2228: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:2722: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:2876: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:3458: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:3620: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:4064: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:4091: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:4119: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:4572: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:4904: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:5010: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:5911: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:7738: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:8402: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:8645: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:8902: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:8984: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:9174: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:9526: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:9977: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:10506: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:10594: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:10742: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 11:11374: Expected an assignment or function call and instead saw an expression no-unused-expressions
This is not the only file that returns an error; there are other animation files but the error is the same. I searched for a solution, but I couldn't find one. I don't know if this is relevant, but I'm using react-scripts
to do the npm run build
. I hope this is clear to those who read it. If you need more information, let me know and thank you in advance
I tried changing the import but nothing changed
Those aren't errors, they're eslint warnings. Add
src/gsap-plugins/ScrollSmoother.min.js
to your .eslintignore
file since that's not code you're controlling anyway.