1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to use Prettier as beautifier of user's code?

Discussão em 'Angular' iniciado por user3033810, Julho 1, 2025.

  1. user3033810

    user3033810 Guest

    In my project Prettier is already connected for the project code formatting. I'm trying to use Prettier for user's code formatting in Ace Editor:

    import * as prettier from 'prettier';
    import * as babel from 'prettier/plugins/babel';
    import * as estree from 'prettier/plugins/estree';
    ...
    const code = this.editor.getValue();
    const formatted = prettier.format(code, {
    parser: 'babel',
    plugins: [babel, estree]
    });


    ...but I get an error:


    Uncaught TypeError: Super constructor null of anonymous class is not a constructor
    ​

    I've tried different options - nothing has helped yet. Maybe someone has a successful experience - I would be very grateful.

    Continue reading...

Compartilhe esta Página