text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  /*
   * SonarTS
   * Copyright (C) 2017-2019 SonarSource SA
   * mailto:info AT sonarsource DOT com
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 3 of the License, or (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public License
   * along with this program; if not, write to the Free Software Foundation,
   * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
   */
  const tslint = require("tslint");
  const sonarAnalysis_1 = require("../utils/sonarAnalysis");
  class Rule extends tslint.Rules.AbstractRule {
      static formatMessage() {
          return "Change this pattern to not be empty.";
      }
      apply(sourceFile) {
          return new Visitor(this.getOptions().ruleName).visit(sourceFile).getIssues();
      }
  }
  Rule.metadata = {
      ruleName: "no-empty-destructuring",
      description: "Destructuring patterns should not be empty",
      rationale: tslint.Utils.dedent `
        Destructuring is a convenient way of extracting multiple values from data stored in
        (possibly nested) objects and arrays. However, it is possible to create an empty pattern that
        has no effect. When empty curly braces or brackets are used to the right of a property name
        most of the time the intent was to use a default value instead.`,
      optionsDescription: "",
      options: null,
      rspecKey: "RSPEC-3799",
      type: "functionality",
      typescriptOnly: false,
  };
  exports.Rule = Rule;
  class Visitor extends sonarAnalysis_1.SonarRuleVisitor {
      visitBindingPattern(node) {
          if (node.elements.length === 0) {
              this.addIssue(node, Rule.formatMessage());
          }
          super.visitBindingPattern(node);
      }
  }
  //# sourceMappingURL=noEmptyDestructuringRule.js.map