Prettier plugin for formatting T-SQL (Microsoft SQL Server) using Microsoft's official ScriptDom parser (TSql180Parser), supporting syntax up to SQL Server 2025. Version 0.6.4 is beta (breaking changes possible before 1.0). Requires .NET 8+ runtime and Node >=20. Ships TypeScript types. Differentiates from other SQL formatters by using the official parser, preserving comments and batch separators, and covering a broad range of T-SQL features including DML, CTEs, window functions, pivot, temporal tables, JSON functions, and full-text predicates. Integrates with Prettier's editor extensions.
npm install prettier-plugin-tsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installation, configuration, and basic formatting of a T-SQL file using Prettier with the plugin. Shows system requirement (dotnet) and common config options.
Check documentation for supported statements and pending implementation list. Expect to manually review output.
Install .NET 8+ Runtime from https://dotnet.microsoft.com/download/dotnet/8.0. SDK is not required.
Upgrade Node.js to version 20.x or later.
Pin to exact version. Watch for updates before upgrading.
Review output for unformatted sections. Report issues to plugin repository.
Download and install .NET 8+ Runtime from https://dotnet.microsoft.com/download/dotnet/8.0
Run `npm install --save-dev prettier-plugin-tsql`. Add `"plugins": ["prettier-plugin-tsql"]` to your Prettier config.
Use import syntax or dynamic import. Ensure your project is configured as ESM (e.g., `"type": "module"` in package.json).