public JavaScriptSquidSensor(
      CheckFactory checkFactory,
      FileLinesContextFactory fileLinesContextFactory,
      FileSystem fileSystem,
      NoSonarFilter noSonarFilter,
      @Nullable CustomJavaScriptRulesDefinition[] customRulesDefinition) {

    this.checks =
        JavaScriptChecks.createJavaScriptCheck(checkFactory)
            .addChecks(CheckList.REPOSITORY_KEY, CheckList.getChecks())
            .addCustomChecks(customRulesDefinition);
    this.fileLinesContextFactory = fileLinesContextFactory;
    this.fileSystem = fileSystem;
    this.noSonarFilter = noSonarFilter;
    this.mainFilePredicate =
        fileSystem
            .predicates()
            .and(
                fileSystem.predicates().hasType(InputFile.Type.MAIN),
                fileSystem.predicates().hasLanguage(JavaScriptLanguage.KEY));
    this.parser = JavaScriptParserBuilder.createParser(getEncoding());
  }