task.js 913 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const options_1 = require("./options");
  4. class TslintFixTask {
  5. constructor(configOrPath, options) {
  6. if (options) {
  7. this._configOrPath = configOrPath;
  8. this._options = options;
  9. }
  10. else {
  11. this._options = configOrPath;
  12. this._configOrPath = null;
  13. }
  14. }
  15. toConfiguration() {
  16. const path = typeof this._configOrPath == 'string' ? { tslintPath: this._configOrPath } : {};
  17. const config = typeof this._configOrPath == 'object' && this._configOrPath !== null
  18. ? { tslintConfig: this._configOrPath }
  19. : {};
  20. const options = {
  21. ...this._options,
  22. ...path,
  23. ...config,
  24. };
  25. return { name: options_1.TslintFixName, options };
  26. }
  27. }
  28. exports.TslintFixTask = TslintFixTask;