全局安装

也可以使用 npm install eslint --global 在全局而不是本地安装 ESLint。但是,不推荐这样做,如果您全局安装 ESLint,您使用的任何插件或可共享配置仍必须安装在本地。

It is also possible to install ESLint globally, rather than locally, using npm install eslint --global. However, this is not recommended, and any plugins or shareable configs that you use must still be installed locally if you install ESLint globally.