Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[enhancement] Update babel-code-frame to @babel/code-frame #4632

Merged
merged 1 commit into from Apr 3, 2019

Conversation

bjornstar
Copy link
Contributor

PR checklist

  • New feature, bugfix, or enhancement
    • Includes tests

Overview of change:

babel-code-frame is deprecated and future updates will be published under the babel npm organization as @babel/code-frame.

Updated babel-code-frame v6.22.0 to @babel/code-frame v7.0.0
Updated @types/babel-code-frame v6.20.0 to @types/babel__code-frame v7.0.1

chalk now has types so we don't need to cast as any in the test.

Is there anything you'd like reviewers to focus on?

The test used old code-frame behavior:

first failure (first-name)
> 1 | module CodeFrameModule {
 2 |     export class CodeFrameClass {
 3 |         private name: string;
 4 | 

full failure (full-name)
> 1 | module CodeFrameModule {
 2 |     export class CodeFrameClass {
 3 |         private name: string;
 4 | 

warning failure (warning-name)
> 1 | module CodeFrameModule {
 2 |     export class CodeFrameClass {
 3 |         private name: string;
 4 | 

&<>'" should be escaped (escape)
> 1 | module CodeFrameModule {
   |  ^
 2 |     export class CodeFrameClass {
 3 |         private name: string;
 4 | 

last failure (last-name)
   7 |         }
  8 |     }
>  9 | }
    | ^
 10 | 

The new one looks much better:

first failure (first-name)
> 1 | module CodeFrameModule {
  2 |     export class CodeFrameClass {
  3 |         private name: string;
  4 | 

full failure (full-name)
> 1 | module CodeFrameModule {
  2 |     export class CodeFrameClass {
  3 |         private name: string;
  4 | 

warning failure (warning-name)
> 1 | module CodeFrameModule {
  2 |     export class CodeFrameClass {
  3 |         private name: string;
  4 | 

&<>'" should be escaped (escape)
> 1 | module CodeFrameModule {
    |  ^
  2 |     export class CodeFrameClass {
  3 |         private name: string;
  4 | 

last failure (last-name)
   7 |         }
   8 |     }
>  9 | }
     | ^
  10 | 

CHANGELOG.md entry:

[enhancement] Update babel-code-frame to @babel/code-frame

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @bjornstar! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, thank you!

@adidahiya adidahiya merged commit 71be0d7 into palantir:master Apr 3, 2019
@bjornstar bjornstar deleted the update-babel-code-frame branch April 3, 2019 23:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants