Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure package.json to run eslint on js and jsx files

This post works for linting all .js files in a project.

How do I lint all .jsx files in addition to all .js files?

I've gotten this to work:

    "lint": "./node_modules/.bin/eslint \"./**/*.js\" \"./**/*.jsx\""

However, I think that there is a more succint way to match both .js and .jsx file extensions.

like image 639
SeanPlusPlus Avatar asked Dec 13 '22 16:12

SeanPlusPlus


1 Answers

You could also try the following which is working fine on my machine:

"lint": "eslint \"**/*.{js,jsx}\""
like image 190
Christian Gürtler Avatar answered Apr 29 '23 12:04

Christian Gürtler