[英]Use a different shareable config for eslint in a subfolder of a project
I have a node 8 project in ES6, that also contains some client-side code in ES5. 我在ES6中有一个node 8项目,在ES5中也包含一些客户端代码。 I'm linting the node code with eslint and using airbnb-base for it.
我用eslint插入节点代码,并使用基于airbnb的代码。
However, the client-side code is ES5, so I want to use airbnb-base/legacy for it. 但是,客户端代码是ES5,因此我想使用airbnb-base / legacy。 The problem is that the ES5 client-side code is in a subfolder of the project, which automatically inherits the main eslint configuration (so also the
extends: ["airbnb-base"]
. 问题是ES5客户端代码位于项目的子文件夹中,该子文件夹自动继承了主要的eslint配置(因此,还
extends: ["airbnb-base"]
。
Is there a way to specify extends: ["airbnb-base/legacy"]
for folder below the main config, and not inherit airbnb-base
? 有没有一种方法可以指定
extends: ["airbnb-base/legacy"]
用于主配置下的文件夹,而不继承继承airbnb-base
?
如果在子文件夹的.eslintrc.js
指定root: true
,则可以extends: ["airbnb-base/legacy"]
,它不会从父目录继承任何配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.