简体   繁体   English

全局 ESLint 覆盖项目 ESLint

[英]Global ESLint overrides project ESLint

I have my default ESLint style used in all my projects (it has been set up globally in VS Code preferences file / settings.json), but there are some other projects that have its specific lint configuration (.eslintrc file under the project folder).我的所有项目都使用了默认的 ESLint 样式(它已在 VS Code 首选项文件/settings.json 中全局设置),但还有一些其他项目具有其特定的 lint 配置(项目文件夹下的 .eslintrc 文件) .

However, when coding for that specific project, the lint used is still the global one.但是,在为该特定项目编码时,使用的 lint 仍然是全局的。

How to override the global ESLint with the project one for all projects?如何用一个项目覆盖所有项目的全局 ESLint? So that anytime I have a new project with its own ESLint config, there is no need to re-config the global ESLint for my default projects.因此,每当我有一个带有自己的 ESLint 配置的新项目时,都无需为我的默认项目重新配置全局 ESLint。

Thank you.谢谢你。

Add ”root”: true, to your .eslintrc file.添加”root”: true,到你的.eslintrc文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM