Hello-World-Software-Studios / calculator

Carpenter's tool for wall layout
0 stars 1 forks source link

Explore: Install ESLint and configure your project #15

Closed ecumene closed 3 years ago

ecumene commented 3 years ago

https://reactjs.org/docs/hooks-reference.html#usememo

Change makeAList to a useMemo

JPM709 commented 3 years ago

installed eslint, ran it on Calculator.jsx, and got: C:\Users\murph\Documents\GitHub\calculator\src\components\Calculator.jsx 1:26 error 'useMemo' is defined but never used no-unused-vars 65:24 error ' can be escaped with ', ‘, ', ’ react/no-unescaped-entities

✖ 2 problems (2 errors, 0 warnings)

will close issue once useMemo is implemented correctly, and will post a 0-error linter report to accompany it

ecumene commented 3 years ago

See if you can install the VS code extension. It'll automate running the command for you. Also check out this tutorial: https://thomaslombart.com/setup-eslint-prettier-react/

It's very good!

JPM709 commented 3 years ago

So I read that tutorial, and followed all the steps. I believe I have everything installed for an automated pre-commit linting and fixing, so Ill show you on thursday

JPM709 commented 3 years ago

So Ive a got a linting and formatting workflow set up. I can lint on command line, context menu, quick-fix, and have a lint-staged command so I can lint and commit right from the terminal.