0

My NodeJS project has the following structure:

project
|
|- client
|  |
|  |- .eslintrc.yml
|  | ...
|
|- server
...

Both client and server folders contain JS code.

For code linting I use eslint with the following config:

extends: ../node_modules/eslint-config-airbnb/.eslintrc
rules:
  import/no-commonjs:
    - error
env:
  browser: true

I use Intellij IDEA's integration with ESLint for the real-time linting. The problem is that IDEA checks all the files in the project, while I want it to only check files from the client folder.

2
  • 1
    .eslintignore should help. Commented Jan 24, 2019 at 11:32
  • @YamanJain you suggest ignoring every folder in the project except client? Commented Jan 24, 2019 at 11:44

1 Answer 1

2

You have 2 options here:

  1. add server/* to .eslintignore

or

  1. set up ESLint inspection to work for the desired scope only:

    • in Settings | Appearance & Behavior | Scopes, create a new scope with server excluded (or just client included recursively)
    • in Settings | Editor | Inspections | JavaScript | Code quality tools, choose this scope for ESLint inspection (in screenshot below, sub is a name of custom scope):

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.