I have some services organized into a monorepo in such a fashion:
repo_root/
├── services/
│ ├── service_one/
│ ├── service_two/
│ └── service_three/
├── package.json
├── node_modules
├── .eslintrc
Additionally, each individual service has its own package.json
and node_modules
. I would like to use the eslint configuration stored in the repo_root
directory to lint individual services. My problem is that when I try to run something like
eslint services/service_one
for example, it fails to find the eslint plugin modules that are required by .eslintrc
and installed in the node_modules
directory of repo_root
.
I'd like to avoid redundantly requiring these plugin modules in every service. Is there anyway to configure eslint to intelligently find the modules even though they are in the parent directory of the services themselves?
For anyone wondering, my problem was I was running the command using a globally installed eslint, which in turn looked for global modules. After changing it to run a local version of eslint, everything worked fine!