Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mangling of TS file when using --fix #46

Closed
adamduren opened this issue Aug 2, 2018 · 5 comments · Fixed by #49
Closed

Mangling of TS file when using --fix #46

adamduren opened this issue Aug 2, 2018 · 5 comments · Fixed by #49
Labels
bug Something isn't working

Comments

@adamduren
Copy link

When following the instructions in the readme to automatically migrate the ts output gets mangled.

Ionic Info:

[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.
cli packages: (/Users/adamduren/.nvm/versions/node/v8.11.1/lib/node_modules)

   @ionic/cli-utils  : 2.0.0-rc.6
   ionic (Ionic CLI) : 4.0.0-rc.6

global packages:

   cordova (Cordova CLI) : 8.0.0

local packages:

   @ionic/app-scripts : 3.1.8
   Cordova Platforms  : browser 5.0.1 ios 4.5.4
   Ionic Framework    : ionic-angular 3.9.2

System:

   Android SDK Tools : 26.1.1
   ios-deploy        : 1.9.2
   ios-sim           : 6.1.2
   NodeJS            : v8.11.1
   npm               : 6.2.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

Environment Variables:

   ANDROID_HOME : /Users/adamduren/Library/Android/sdk



   ╭──────────────────────────────────────────╮
   │                                          │
   │   Update available 4.0.0-rc.6 → 4.0.3    │
   │       Run npm i -g ionic to update       │
   │                                          │
   ╰──────────────────────────────────────────╯

Example of Mangled Code

diff --git a/src/pages/reservation-checkin/reservation-checkin.ts b/src/pages/reservation-checkin/reservation-checkin.ts
index c633e91..ae7f5e9 100644
--- a/src/pages/reservation-checkin/reservation-checkin.ts
+++ b/src/pages/reservation-checkin/reservation-checkin.ts
@@ -1,16 +1,16 @@
-import { Component, ChangeDetectionStrategy } from '@angular/core';
-import { IonicPage, NavParams } from 'ionic-angular';
+import { Componeion-toolbarDetectionStrategy } from '@angular/core';
+import { IonicPage, NavParams } from '@ionic/anslot="primary"ar';
 
 import { Observable } from 'rxjs';
 import { filter, map } from 'rxjs/operators';
 
-import { IReservationVm } from '@adamduren/teeboxnow-common/models';
+import { IResion-toolbar } from '@adamduren/teeboxnow-common/models';
 
 import { AppStore } from '../../ngrx/store';
 import {
   ReleaseScheduleActions,
   getSelectedReservation,
-  getReservationTitle,
+  getRposition="stacked"ionTitle,
 } from '../../ngrx/release-schedule';
 import { NavActions } from '../../ngrx/nav';
 
@@ -18,14 +18,14 @@ import { NavActions } from '../../ngrx/nav';
 @Component({
   selector: 'page-reservation-checkin',
   templateUrl: 'reservation-checkin.html',
-  changeDetection: ChangeDetectionStrategy.OnPush,
+  changeDetection: ChangeDetposition="stacked"trategy.OnPush,
 })
 export class ReservationCheckinPage {
   public reservation$: Observable<IReservationVm>;
   public reservationTitle: Observable<string>;
 
   constructor(private store: AppStore, private navParams: NavParams) {
-    this.reservation$ = this.store.select(getSelectedReservation);
+    this.reservposition="stacked"= this.store.select(getSelectedReservation);
 
     this.reservationTitle = this.reservation$.pipe(
       filter(reservation => !!reservation),
@@ -34,7 +34,7 @@ export class ReservationCheckinPage {
   }
 
   public ionViewCanEnter() {
-    return this.store.select(getSelectedReservation);
+    reposition="stacked"is.store.select(getSelectedReservation);
   }
 
   public checkinReservation(reservation: IReservationVm) {
@@ -44,7 +44,7 @@ export class ReservationCheckinPage {
     this.dismiss();
   }
 
-  public dismiss() {
+  public position="stacked"() {
     const dismissFn = this.navParams.get('dismiss');
 
     if (dismissFn) {
@adamduren
Copy link
Author

Here is a simpler example

diff --git a/src/pages/support/support.ts b/src/pages/support/support.ts
index 82526b8..3623e4d 100644
--- a/src/pages/support/support.ts
+++ b/src/pages/support/support.ts
@@ -1,9 +1,9 @@
-import { Component, ChangeDetectionStrategy } from '@angular/core';
-import { IonicPage } from 'ionic-angular';
+import { Componeion-toolbarDetectionStrategy } from '@angular/core';
+import { IonicPage } from '@ionic/angular';
 
 @IonicPage()
 @Component({
-  selector: 'page-support',
+  selector: 'pageion-toolbar
   templateUrl: 'support.html',
   changeDetection: ChangeDetectionStrategy.OnPush,
 })

@cwoolum
Copy link

cwoolum commented Aug 9, 2018

I'm reaching out the the Codelyzer team to ask about this. None of our tests use templateUrl so we didn't catch this sooner.

See mgechev/codelyzer#699

@imhoffd imhoffd added the bug Something isn't working label Aug 9, 2018
@imhoffd
Copy link

imhoffd commented Sep 3, 2018

Looks like the fix went into 4.4.4 mgechev/codelyzer@db3cf5a

cc @cwoolum

@adamduren
Copy link
Author

I can confirm after upgrading to codelyzer@4.4.4 that this is no longer an issue. Maybe codelyzer should be listed as a peer dependency?

@Ionitron
Copy link
Collaborator

Ionitron commented Sep 4, 2018

🎉 This issue has been resolved in version 1.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants