我如何在子模块中也使用相同的tslint.json?

时间:2018-09-24 08:30:15

标签: json angular configuration lint tslint

一个大型Angular 5项目提供了几个子模块(来自不同的存储库),我无法指定子模块tslint.json的node_modules / codelyzer或tslint-base.json的路径。

树是这样的:

getName()

tslint-base.json:

Map<Place,Name>

当然,当我们使用IDE(IntelliJ IDEA Ultimate)打开项目的根目录时,它会很好地工作,但是我们通常是从子模块之一而不是项目根目录中打开它。因此,IDE从子模块的tslint.json中看不到node_modules / codelyzer文件夹。我已经尝试过:

1。 tslint.json

enum PlaceNameMap implements Function<Place,Name>, Supplier<Place> {
    INSTANCE;

    private Map<Place,String> map = new HashMap<>();

    public Place createPlace(String name) {
        PlaceImpl result = new PlaceImpl(name);
        add(result, name);
        return result;
    }
    public void add(Place p, String name) {
        map.put(p, name);
    }
    public String apply(Place p) {
        return map.get(p);
    }
}

2。 tslint.json

no_proxy_match = http://localhost:8082*

3。 tslint.json

tslint-base.json
node_modules
...
modules
  submod1
    tslint.json
    components
    ...
  submod2
    tslint.json
    components
    ...

4。 tslint.json

{
    "rulesDirectory": [
        "node_modules/codelyzer"
    ],
    "rules": {
      ...
    }
}

我也尝试了这些组合。但这不起作用...

我怎么了?

0 个答案:

没有答案