How to install @wordpress/eslint-plugin to make it work?
-
Helo all,
I’m trying to replace deprecated npm package
eslint-config-wordpress
, which works great without a hassle. The recommenrded package now is@wordpress/eslint-plugin
, which doesn’t seem to work well with VSCode (on Linux Mint) or I don’t know how to install it.1 step: I went to a WordPress main local installation (I’m using Local by Flywheel – works great) and opened a terminal there. In the terminal I typed what I’ve found on NPM’s website: npm install @wordpress/eslint-plugin –save-dev
2 step: I created .eslintrc file and added
{ "extends": [ "plugin:@wordpress/eslint-plugin/recommended" ] }
Now going to VSCode and opening any js file from any theme or plugin gives me ‘Failed to load plugin ‘@wordpress/eslint-plugin’ declared in ‘../../../../../../../.eslintrc’: Cannot find module ‘@wordpress/eslint-plugin’ Require stack: – /home/user/www/__placeholder__.js Referenced from: /home/user/www/.eslintrc’ error.
I think I don’t understand how this should work and how to install it properly. With mentioned deprecated plugin it was really straightforward and worked great.
I appreciate some help in this regard.
Best regards, Dan.
- The topic ‘How to install @wordpress/eslint-plugin to make it work?’ is closed to new replies.