DEV Community

Discussion on: How To Set Up ESLint, TypeScript, Prettier with Create React App

Collapse
 
gruckion profile image
Stephen Rayner

If you are having the same issue I was the cause is;

"lint": "eslint './src/**/*.{ts,tsx}'",
Enter fullscreen mode Exit fullscreen mode

In order to get this to work, I had to remove the single quotes.

I am not sure why the single quote approach doesn't work for me. I read over the documentation and found it is called "glob" notation and it depends on the console your using (I am using git bash).

Placing your glob in double quotes will use nodes glob format. If you want to test it and don't want to globally install eslint use;

npx eslint './src/**/*.{ts,tsx}'

This works fine for me. with and without double or single quotes.

eslint.org/docs/user-guide/command...

If anyone has any idea why I can't run the script from my package.json with single quotes I would love to know.

Collapse
 
simorocksthebest profile image
simorocksTheBest

It's an oddity of the operating system, I bet you were working with a windows 10 machine.

I got the exact same error, this is what I did.

lint: "eslint \"./src/*/.{ts,tsx}\""

stackoverflow.com/questions/481043...

Thread Thread
 
oh_jeez_rick profile image
Gavin Chan

thank you. It works in Win10 Pro now.