I attach a .eslintrc.json file just to use with p5.js

I made this with all the instructions from p5.js taken from the reference. Many of them are repeated ( generates only warnings) and i commented the category of instructions. This could be combined with

And this one with commented also duplicates so no warnings generate. dont know if it works properly, because for example height or width are repeated many times in different categories of reference

To use them:
npm install --save @types/p5

Just if its useful for the community

1 Like

Thanks @edufissure, that looks interesting! Can you explain a little what this is for? I’m not really familiar with eslint.

How does it relate/compare to what the repo below is doing?

From my little experience.
Im not using TypeScript but JS.
So eslint is a popular tool too help autocomplete, and detect errors and bad practices in your code.
The problem is that eslint recognices the instructions in JS ( let, const, for, array.lenght…)…But it does not recognize p5.js instructions ( setup, draw, createcanvas…), so it gave lots of errors with correct code.
Also you couldnt read the help because of the errors…with this config file you make eslint recognize all the p5.js instructions ( dont give error on createCanvas for example) and with type/p5.js you can put the mouse over createCanvas…and explains the function, and their parameters…

Sorry my english is not good

2 Likes