icon-template-rule.js 1.1 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. /**
  3. * Use of this source code is governed by an MIT-style license that can be
  4. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. exports.IconTemplateRule = void 0;
  8. const schematics_1 = require("@angular/cdk/schematics");
  9. const elements_1 = require("../../../utils/ng-update/elements");
  10. class IconTemplateRule extends schematics_1.Migration {
  11. constructor() {
  12. super(...arguments);
  13. this.enabled = false;
  14. }
  15. visitTemplate(template) {
  16. (0, elements_1.findElementWithClassName)(template.content, 'anticon', 'i')
  17. .forEach(offset => {
  18. this.failures.push({
  19. filePath: template.filePath,
  20. position: template.getCharacterAndLineOfPosition(offset),
  21. message: `Found deprecated css selector "i.anticon" component. Use "<nz-icon>" to instead please.`
  22. });
  23. });
  24. }
  25. }
  26. exports.IconTemplateRule = IconTemplateRule;
  27. //# sourceMappingURL=icon-template-rule.js.map