# `Soundcheck.Check.Warning.InvalidLiveComponent`
[🔗](https://github.com/leonqadirie/soundcheck/blob/v0.1.0/lib/soundcheck/check/warning/invalid_live_component.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

Flags `<.live_component>` calls that LiveView rejects when it
renders them: a missing `id` or `module`, or a `module` that is not
a LiveComponent. Each raises `ArgumentError` on render, and the
compiler reports none of them.

Before:

    <.live_component module={MyAppWeb.PostLive.FormComponent} post={@post} />

After:

    <.live_component
      module={MyAppWeb.PostLive.FormComponent}
      id={@post.id || :new}
      post={@post}
    />

The module check expands the alias as the template's module does and
reads the compiled module; modules it cannot load are skipped. Calls
that spread attributes (`{@rest}`) are skipped, since the spread may
carry both.

Confidence: high. Tier: semantic for the module check (run `mix compile` before `mix credo`); the missing-attribute checks work without compiling.

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:excluded_paths`

  Paths to skip (atoms, binaries as path segments, or regexes).

*This parameter defaults to* `[~r/\/test\//, "test"]`.

### `:strict`

  Unused.

*This parameter defaults to* `false`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
