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

**URL:** <https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444>\
**Category:** p5.js\
**Created:** [December 8, 2024, 7:38pm UTC](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444 "2024-12-08T19:38:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edufissure](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@edufissure](https://discourse.processing.org/u/edufissure)\
**Post date:** [December 8, 2024, 7:38pm UTC](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444/1 "2024-12-08T19:38:35Z")

</div>

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

> **[{ "extends": \["eslint-config-manzdev","plugin:jsdoc/recommended"\], "pl...](https://pastebin.com/PaYnfmNV)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

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

> **[{ "extends": \["eslint-config-manzdev","plugin:jsdoc/recommended"\], "pl...](https://pastebin.com/ybEd9K21)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

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

Just if its useful for the community

---

<div class="post-metadata">

**Author:** ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)\
**Post date:** [December 9, 2024, 1:17pm UTC](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444/2 "2024-12-09T13:17:01Z")

</div>

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?

> **[GitHub - p5-types/p5.ts](https://github.com/p5-types/p5.ts)**
>
> Contribute to p5-types/p5.ts development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![edufissure](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@edufissure](https://discourse.processing.org/u/edufissure)\
**Post date:** [December 9, 2024, 7:19pm UTC](https://discourse.processing.org/t/i-attach-a-eslintrc-json-file-just-to-use-with-p5-js/45444/3 "2024-12-09T19:19:49Z")

</div>

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
