1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | exports.MiscClassNamesMigration = void 0;
|
---|
11 | const schematics_1 = require("@angular/cdk/schematics");
|
---|
12 | const ts = require("typescript");
|
---|
13 | /**
|
---|
14 | * Migration that looks for class name identifiers that have been removed but
|
---|
15 | * cannot be automatically migrated.
|
---|
16 | */
|
---|
17 | class MiscClassNamesMigration extends schematics_1.Migration {
|
---|
18 | constructor() {
|
---|
19 | super(...arguments);
|
---|
20 | // Only enable this rule if the migration targets version 6. The rule
|
---|
21 | // currently only includes migrations for V6 deprecations.
|
---|
22 | this.enabled = this.targetVersion === schematics_1.TargetVersion.V6;
|
---|
23 | }
|
---|
24 | visitNode(node) {
|
---|
25 | if (ts.isIdentifier(node)) {
|
---|
26 | this._visitIdentifier(node);
|
---|
27 | }
|
---|
28 | }
|
---|
29 | _visitIdentifier(identifier) {
|
---|
30 | // Migration for: https://github.com/angular/components/pull/10279 (v6)
|
---|
31 | if (identifier.getText() === 'MatDrawerToggleResult') {
|
---|
32 | this.createFailureAtNode(identifier, `Found "MatDrawerToggleResult" which has changed from a class type to a string ` +
|
---|
33 | `literal type. Your code may need to be updated.`);
|
---|
34 | }
|
---|
35 | // Migration for: https://github.com/angular/components/pull/10398 (v6)
|
---|
36 | if (identifier.getText() === 'MatListOptionChange') {
|
---|
37 | this.createFailureAtNode(identifier, `Found usage of "MatListOptionChange" which has been removed. Please listen for ` +
|
---|
38 | `"selectionChange" on "MatSelectionList" instead.`);
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
42 | exports.MiscClassNamesMigration = MiscClassNamesMigration;
|
---|
43 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaW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