ESLint and meteor npm

Hello,

I’m fairly new to Meteor, I have installed it a few days ago on a Linux computer, and I’m using VS Code (which I like a lot).

I would like to use the ESLint extension for VS Code which requires ESLint to be installed, preferably globally (if I understood it well).

I have not installed nodejs or npm, but i tried to use the meteor bundled version of npm to install ESLint (command: meteor npm install -g eslint). It does seem to work, the console gives me a success message, the latest version of eslint appears in the packages when I type metor npm list -g --depth=0, but VS Code does not seem to locate it and stubbornly continues to tell me to install it globally.

What would you recommend ? Should I install nodejs and npm, then install ESLint with the “official” npm command line, or is there any way to make it work with the bundled npm coming with Meteor ?

Thanks in advance

-g will make it install globally so you should remove that. Best use --save-dev so it’s in your dev dependencies. More info here

1 Like

Important to know that Meteor ships a version of node and npm that’s pinned for each Meteor version.

Any modules you install globally with Meteor’s npm will be installed globally only for that version of meteor
VS Code looks for a system wide install and so doesn’t find it.

If you are globally installing modules, always use the system-wide npm
Though for modules like eslint, I always install them locally anyway.

For local installs always use meteor npm

1 Like

Off topic - does eslint work as expected with async / await and decorators?

There used to be some issue where eslint did not like promises / decorators in JS from memory.