Bug #21448

npm lint fails when plugin has additional dependencies

Added by Tomáš Strachota over 4 years ago. Updated almost 4 years ago.

JavaScript stack
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


The lint script in the foreman just includes files from plugins into a lint run executed from the context of the foreman. This causes troubles when a plugin adds some custom lint dependency (like eslint-plugin-jest from the example below).

[foreman|2.4.1|develop] npm run lint

> TheForemanDevDeps@1.17.0 lint /home/vagrant/foreman/foreman
> eslint -c .eslintrc webpack/ script/ $(./script/foreman_plugins_eslint.js) || exit 0

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-jest". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-jest is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-jest@latest --save-dev

If you still can't figure out the problem, please stop by to chat with the team.

Associated revisions

Revision 9d366d05 (diff)
Added by Tomáš Strachota over 4 years ago

Fixes #21448 - execute npm run lint from context of plugins


#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request added

#2 Updated by Walden Raines over 4 years ago

  • Target version changed from 224 to 228

#3 Updated by Daniel Lobato Garcia over 4 years ago

  • Legacy Backlogs Release (now unused) set to 296

#4 Updated by Anonymous over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF