OXC.Lint.TypeAware (OXC v0.19.0)

Copy Markdown View Source

Runs type-aware TypeScript lint rules through tsgolint headless mode.

Summary

Functions

Parse tsgolint headless output frames into raw findings, or the error messages it reported.

Run tsgolint on a list of files.

Types

diagnostic()

@type diagnostic() :: OXC.Lint.diagnostic()

option()

@type option() ::
  {:type_aware, true}
  | {:rules,
     %{
       required(String.t()) =>
         OXC.Lint.severity() | {OXC.Lint.severity(), term()}
     }}
  | {:plugins, [OXC.Lint.plugin()]}
  | {:tsgolint, String.t()}
  | {:type_check, boolean()}
  | {:report_syntactic, boolean()}
  | {:report_semantic, boolean()}
  | {:fix, boolean()}
  | {:fix_suggestions, boolean()}
  | {:source_overrides, %{required(String.t()) => String.t()}}
  | {:cwd, Path.t()}

severity()

@type severity() :: OXC.Lint.severity()

Functions

parse_output(output, severities \\ %{})

Parse tsgolint headless output frames into raw findings, or the error messages it reported.

severities maps tsgolint rule names to their configured OXC.Lint.severity/0.

run(files, opts \\ [])

@spec run([String.t()], [option()]) ::
  {:ok, [diagnostic()]} | {:error, [diagnostic()]}

Run tsgolint on a list of files.