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

deno fmt - Formatting a file saved as UTF-8 with BOM leads to badly formatted text #5850

Closed
dsherret opened this issue May 25, 2020 · 1 comment · Fixed by #5881
Closed
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@dsherret
Copy link
Member

dsherret commented May 25, 2020

Input code (saved as UTF-8 w/ BOM):

/// <reference path='firebase.d.ts'/>

export declare class AngularFire {
    asArray(): FirebaseArray;
}

export interface FirebaseArray {
    getItem(recOrIndex: any): any;
    getChild(recOrIndex: any): any;
    add(newData: any): void;
    remove(recOrIndex: any): void;
    save(recOrIndex: any): void;
    keyify(snap: any): any;
    created(snap: any): void;
    moved(snap: any): void;
    updated(snap: any): void;
    removed(snap: any): void;
    bulkUpdate(items: Object): void;
    spliceOut(key: any): void;
    indexFor(key: any): number;
    getRecord(key: any): any;
    list: any[];
}

Output code:

/// <reference path='firebase.d.ts'/>

export declare class AngularFire {
  asArray(): FirebaseArray;
}

export interface FirebaseArray {
  getItem(recOrIndex: x: ): ): ;
  getChild(recOrIndex: x: ): ): ;
  add(newData: a: ): ): v;
  remove(recOrIndex: x: ): ): v;
  save(recOrIndex: x: ): ): v;
  keyify(snap: p: ): ): ;
  created(snap: p: ): ): v;
  moved(snap: p: ): ): v;
  updated(snap: p: ): ): v;
  removed(snap: p: ): ): v;
  bulkUpdate(items: Object): ): v;
  spliceOut(key: y: ): ): v;
  indexFor(key: y: ): ): num;
  getRecord(key: y: ): ): ;
  list: t: [];
}

I'm thinking deno fmt should strip the BOM before providing the string to dprint then save the file with BOM afterwards.

@ry ry added bug Something isn't working correctly cli related to cli/ dir labels May 25, 2020
@dsherret
Copy link
Member Author

I'll fix this one.

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

Successfully merging a pull request may close this issue.

2 participants