# `LexCredo.Check.Design.NoNestedModules`
[🔗](https://github.com/sippy-platform/lex_credo/blob/main/lib/lex_credo/check/design/no_nested_modules.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

Do not nest module definitions inside other modules.

Nested modules can cause cyclic dependencies and compilation errors.
Each module should live in its own file.

    # BAD
    defmodule Outer do
      defmodule Inner do
        # ...
      end
    end

    # GOOD — separate files, separate modules
    defmodule Outer do
      # ...
    end

    defmodule Outer.Inner do
      # ...
    end

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:exclude_test_files`

  When `true`, skips test files. Default: `true`. Set to `false` to also flag nested modules in test helpers.

*This parameter defaults to* `true`.

## 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*
