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.
You have 2 options here:
server/*
to .eslintignore or
set up ESLint inspection to work for the desired scope only:
server
excluded (or just client
included recursively) sub
is a name of custom scope):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.