Chapter 8 Interacting with a Server

Thanks you for the quick reply! Found a workaround before I read your post - used git command with --no-verify flag, e.g.:

git commit --no-verify -am "Example 8.1. Adding a server proxy (package.json)"

to continue rather than delete code-cafe-backend out of my repo - please let me know if I’m introducing even more issues!

Few notes, should they prove helpful:

  • One correction - I hadn’t enabled husky for cafe-code, this error comes from the husky rules set up in code-cafe-backend. npm run lint run from the code-cafe-backend directory shows same error.
  • (node v18.7.0) is used (edited original post to show log).

And one additional question(s) related to disable linting rules:

  • I was curious to see if the directions for disabling a linting rule specified in Chapter 5 would work as per below, but this insertion didn’t disable the rule. I’m curious as to why this error occured, as from the reading I thought // eslint-disable-next-line would disable all rules. Or do I have to specify a rule, and if so, how do I find out which rule to specify?
// eslint-disable-next-line  
  const name = req?.query?.name?.toLowerCase() || '';

On a related note, got the following error when adding Axios and then importing axios into App.js, even though I had run the command specified in the book: npm install --save axios@0.27.2, and also ran the suggested npm i -S axios.

'axios' should be listed in the project's dependencies. Run 'npm i -S axios' to add iteslintimport/no-extraneous-dependencies
(alias) const axios: AxiosStatic
import axios

However in this instance, Eslint had a quick fix available that auto-filled the rule in question:

// eslint-disable-next-line import/no-extraneous-dependencies
import axios from 'axios';

Hope it wasn’t an error to have accepted the quick fix.