Skip to content

Wire up prettier-plugin-sh for shell files in lint-staged/CI #68

Description

@tomgrv

Problem

prettier-plugin-sh is already an installed dependency in the root package.json, but *.sh files are absent from the lint-staged glob, so the plugin is paid for (install size, config) but never actually applied to any shell script in the repo.

Proposal

  • Add *.sh (and any other shell-script extensions used, e.g. files without extension under src/*/) to the lint-staged configuration in root package.json so prettier with prettier-plugin-sh formats them on commit.
  • Run a one-time repo-wide format pass once the config is in place so existing scripts aren't all flagged as diffs on next touch.
  • Cross-check formatting rules against ShellCheck (see the separate "Add ShellCheck linting to CI" issue) to make sure the two tools don't fight each other (e.g. brace/quoting style).

Where this lives / sync note

This is a root-level tooling config change (package.json, .prettierrc/lint-staged config) — it governs the monorepo's own pre-commit hooks (which this repo dogfoods via its own githooks feature). It doesn't need to propagate into the split repos itself, but any shell files it reformats inside src/<feature>/ will flow through split-monorepo.yml as normal.

Acceptance criteria

  • *.sh files are covered by lint-staged/prettier on commit.
  • A full-repo formatting pass is committed once the config lands, with no further unrelated diff noise.
  • No conflicts with ShellCheck's expectations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions