github dprint/dprint-plugin-typescript 0.35.0

latest releases: 0.91.2, 0.91.1, 0.91.0...
3 years ago

Changes

Import and export declarations are now automatically sorted based on the module specifiers.

To turn this off, specify....

"module.sortImportDeclarations": "maintain",
"module.sortExportDeclarations": "maintain"

...in your "typescript" config.

You can group imports together manually to prevent sorting across groups by adding a blank line or comment. Note that this feature WILL change the behaviour of code because it reorders imports and exports. Be aware of what it's doing!

Install

Install and setup dprint.

Then in your project's .dprintrc.json:

  1. Specify the plugin url in the "plugins" array.
  2. Ensure .ts, .tsx, .js, .jsx, .mjs file extensions are matched in an "includes" pattern.
  3. Add a "typescript" configuration property if desired.
    {
      // ...etc...
      "typescript": {
        // TypeScript & JavaScript config goes here
      },
      "includes": [
        "**/*.{ts,tsx,js,jsx,mjs}"
      ],
      "plugins": [
        "https://plugins.dprint.dev/typescript-0.35.0.wasm"
      ]
    }

Don't miss a new dprint-plugin-typescript release

NewReleases is sending notifications on new releases.