@Test public void should_create_external_repo() { EslintRulesDefinition eslintRulesDefinition = new EslintRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); eslintRulesDefinition.define(context); assertThat(context.repositories()).hasSize(1); Repository eslintRepo = context.repository("external_eslint_repo"); assertThat(eslintRepo.isExternal()).isTrue(); assertThat(eslintRepo.name()).isEqualTo("ESLint"); assertThat(eslintRepo.language()).isEqualTo("js"); assertThat(eslintRepo.rules()).hasSize(607); assertThat(eslintRepo.rule("angular/function-type")).isNotNull(); assertThat(eslintRepo.rule( "no-useless-escape")).isNotNull(); assertThat(eslintRepo.rule("ember/routes-segments-snake-case")).isNotNull(); assertThat(eslintRepo.rule("flowtype/space-before-generic-bracket")).isNotNull(); assertThat(eslintRepo.rule("import/order")).isNotNull(); assertThat(eslintRepo.rule("jsx-a11y/anchor-is-valid")).isNotNull(); assertThat(eslintRepo.rule("promise/no-return-wrap")).isNotNull(); assertThat(eslintRepo.rule("react/no-find-dom-node")).isNotNull(); assertThat(eslintRepo.rule("vue/v-on-style")).isNotNull(); assertThat(eslintRepo.rule("sonarjs/no-duplicate-string")).isNotNull(); }
@Override public void define(Context context) { RULE_LOADERS.forEach((s, externalRuleLoader) -> externalRuleLoader.createExternalRuleRepository(context)); }
EslintRulesDefinition implements RulesDefinition { @Override public void define(Context context) { RULE_LOADERS.forEach((s, externalRuleLoader) -> externalRuleLoader.createExternalRuleRepository(context)); } }
EslintRulesDefinition implements RulesDefinition { @Override public void define(Context context) { RULE_LOADERS.forEach((s, externalRuleLoader) -> externalRuleLoader.createExternalRuleRepository(context)); }  }
EslintRulesDefinition implements RulesDefinition { @Override public void define(Context context) { RULE_LOADERS.forEach((s, externalRuleLoader) -> externalRuleLoader.createExternalRuleRepository(context)); }  @Override void define(Context context); static ExternalRuleLoader loader(String eslintKey); }
EslintRulesDefinition implements RulesDefinition { @Override public void define(Context context) { RULE_LOADERS.forEach((s, externalRuleLoader) -> externalRuleLoader.createExternalRuleRepository(context)); }  @Override void define(Context context); static ExternalRuleLoader loader(String eslintKey); static final String REPOSITORY_KEY; static final String LINTER_NAME; }