prettier-plugin-tsconfig

npm-badge license-badge

✨ An opinionated prettier plugin to format tsconfig.json.

NOTE: work in progress, please check the formatted tsconfig.json before committing changes

This plugin sorts keys in tsconfig.json according to the order of options appearing in the tsconfig reference. Currently does NOT supports comments.

Installation

  1. Install prettier and prettier-plugin-tsconfig.

    $ yarn add --dev prettier prettier-plugin-tsconfig
  1. Add prettier as a runnable script.

    Example:

    {
        "scripts": {
            "format": "prettier --write \"**/*.{js,json,ts}\""
        }
    }
  1. Run prettier.

    $ yarn run format