Eslint script for linting files in specific folder

Viewed 206

I am developing in a monorepo. In our team, we have two different eslint configurations... one for the frontend and another one for the backend.

Our project structure is:

/
  app/
    components/
       SomeComponent/
          XD.js
    App.js

  assets/

  core/

  functions/ <--- Backend
    src/

    node_modules/

    .eslintignore

    .eslintrc.js

    package.json

  node_modules/

  .eslintignore

  .eslintrc.js

  Main.js

  package.json
  

Our top level .eslintignore (not the one in the backend) looks like the following:

node_modules/
core/
functions/

With this, we are trying to ignore the files that are inside these directories when executing the linting script which is situated in our package.json (again, not the one inside the backend folder).

This is the script I have in my package.json

"lint": "eslint *.js ./app/**/*.js"

The problem I am expecting is that my editor detects the linting errors... but when running

yarn lint

I get

$ eslint .js ./app/**/.js ✨ Done in 5.27s.

It seems that the script is not linting all the files... why?

Note:

When changing the script to:

eslint . --ext .js,.jsx,.cjs,.mjs

it works.

0 Answers
Related