I followed your instructions, remixing and also “ripping” the content from one of the examples (I used the rotating rectangle) and was able to reproduce your problem.
After a little fiddling, here’s how I solved it:
Copy across the .eslintrc.json file from the original project to your own
Go into the Glitch terminal and run the command refresh
This gives ESLint new rules to play by, and I think somehow the config specified in the original project stops it checking for unknown globals. However, the new config only kicks in after running refresh.
Thanks @SteGriff that worked! Thanks! I would like to understand this better; seems that if a library is specified there should be a way to make it check for unknown function names in that library.
Another friend pointed out that even with the errors, it worked. So, another reference point although I don’t know enough yet to draw useful conclusions.
Anyway, thanks again, and if anyone can explain further what’s going on I’d welcome that.
The project does “just work”, the script and HTML work together fine, as you know they should
On Glitch, the sketch.js file doesn’t “know about” any other scripts pulled in by your index html, unfortunately. So it can’t say whether the p5 functions exist.
Glitch has some default ESLint rules, which are used to show errors in the editor
Adding your own eslintrc overrides these rules
So, adding an empty {} eslintrc overrides it with “there are no rules”
Instead of overriding the eslintrc, you can also use a little trick to tell Glitch that there are globally available functions/objects, with a comment at the top of your JS like this: