Prettier

This plugin generates the .prettierrc.json file for configuring Prettier. It provides two types: one that allows you to configure any valid API options and another for generating an ignore file.

Usage

The schema for the configuration file is detailed here. For example:

{
    config = {
      arrowParens = "always";
      bracketSpacing = true;
      tabWidth = 80;
    };
}

Produces the following .prettierrc.json:

{
  "arrowParens": "always",
  "bracketSpacing": true,
  "tabWidth": 80
}

Ignore type

The extension can also be configured to accept a list of glob patterns used to determine which files are excluded when prettier is run:

{
  [
    ".direnv"
    ".conform.yaml"
    ".prettierrc.json"
    "tests"
    "CHANGELOG.md"
    "lefthook.yml"
  ]
}

When calling the extension, change the type to ignore:

prettier { data = []; type = "ignore"; }