Brackets-InteractiveLinter icon indicating copy to clipboard operation
Brackets-InteractiveLinter copied to clipboard

How to get ESLint to parse all .js files in a folder?

Open tympapost opened this issue 8 years ago • 9 comments

My javascript code is split into several files in the same folder. Can anybody show me how can I configure InteractiveLinter and/or ESLint in order to parse all the files in the folder, when I have a .js file open?

tympapost avatar Jul 13 '16 07:07 tympapost

Try ESLint CLI http://eslint.org/docs/user-guide/command-line-interface

iegik avatar Aug 30 '16 06:08 iegik

What about https://www.npmjs.com/package/gulp-eslint ? Somebody maybe have idea how to tell eslint to treat all files in folder like a one ?

Migacz85 avatar Sep 27 '18 22:09 Migacz85

Try this ./node_modules/.bin/eslint --fix src

rishiraj824 avatar Jun 20 '19 08:06 rishiraj824

i needed to specify a pattern like so: ./node_modules/.bin/eslint --fix 'src/**/*.js'

alp82 avatar Nov 14 '19 09:11 alp82

Replace ./node_modules/.bin/ with npx (Available since npm 5.2.0) So You can just run npx eslint --fix src

segevofer avatar Jan 22 '20 10:01 segevofer

Sometimes we need to use quotes for the path: "lint": "eslint 'src/**' "

lonelyua avatar Apr 28 '20 08:04 lonelyua

I already used @lonelyua solution but I want to specify target into .eslintrc.js file. Is this possible?

rodmoreno avatar Sep 12 '20 07:09 rodmoreno

@rodmoreno have you tried to use files in .eslint config file?

hamzahsn avatar Jun 16 '21 22:06 hamzahsn

If you wanted to ESLint a .js file in a specific folder

  • npx eslint --fix src folder of the .js file

but if you want to ESLint all the .js file in the whole repository or folder

  • npx eslint --fix .

kembalsado avatar Sep 27 '22 23:09 kembalsado