Skip to content

Npm package doesn't seem to support Luau syntax #614

@ktrz

Description

@ktrz

I've tried using @johnnymorganz/stylua in my node project but it seems to not support Luau specific features.

The following example throws this error: error parsing: error occurred while tokenizing: unexpected character | at line 1, column 19

Reproduction steps:

  import {
    formatCode,
    Config,
    Range,
    OutputVerification,
    LineEndings,
    QuoteStyle,
  } from '@johnnymorganz/stylua';

  function format(code: string): string {
    return formatCode(
      code,
      Config.new(),
      Range.from_values(),
      OutputVerification.None
    );
  }

  format('type Foo = string | number');

Expected behavior

It should support Luau features or allow to choose the supported features

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions