FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

How to use it with prettier API? · Issue #108 · prettier/plugin-python · GitHub

This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Repository navigation

This repository was archived by the owner on Oct 1, 2019. It is now read-only.

How to use it with prettier API? #108

Open

Description

When I try to use it with following configuration, it throws

TypeError: Cannot read property 'toString' of null

prettier.format("print('Hello, world!')", {
  parser: 'python',
  plugins: ['@prettier/plugin-python'],
});

Activity

  1. azz commented on Jul 29, 2018

    Member

    I can't reproduce this error:

    azz at macOS in ~/code/tmp on master [+!?]
    $ cat format.js 
    let prettier = require('prettier')
    
    let result = prettier.format("print('Hello, world!')", {
      plugins: ['@prettier/plugin-python'],
      parser: 'python'
    })
    
    console.log(result)
    azz at macOS in ~/code/tmp on master [+!?]
    $ node format.js 
    print("Hello, world!")
    
    
    azz at macOS in ~/code/tmp on master [+!?]
    $ yarn list prettier
    yarn list v1.3.2
    warning Filtering by arguments is deprecated. Please use the pattern option instead.
    ├─ @prettier/plugin-python@0.0.0-development
    │  └─ prettier@1.9.2
    └─ prettier@1.13.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL