Dependency information
- prettier: 3.6.2
- prettier-plugin-classnames: ^0.8.1
- prettier-plugin-tailwindcss: ^0.6.13
- WebStorm: 2025.1.3
- OS: Windows 11
- Node.js: v22.17.0
Prettier configuration
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"tabWidth": 2,
"printWidth": 100,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-classnames"]
}
Steps to reproduce
- Install
prettier-plugin-classnames with prettier-plugin-tailwindcss in a project
- Configure WebStorm to format with Prettier on save (Settings > Languages & Frameworks > JavaScript > Prettier > On save)
- Open any JSX/TSX file with long className strings
- Scroll to the middle or bottom of the file
- Make any change and save (Ctrl+S)
The current behavior
When saving a file with "format on save" enabled in WebStorm, the editor scroll position jumps to the top of the file after formatting completes. This happens only when prettier-plugin-classnames is active - removing the plugin from the configuration resolves the scroll issue. The plugin works correctly (formats classNames), but causes this scroll position reset.
The expected behavior
The scroll position should remain at the current location after formatting, maintaining the developer's view of the code they're working on. This is the default behavior when using Prettier without this plugin or with only prettier-plugin-tailwindcss.
Dependency information
Prettier configuration
{ "semi": true, "singleQuote": true, "trailingComma": "es5", "useTabs": false, "tabWidth": 2, "printWidth": 100, "bracketSpacing": true, "arrowParens": "always", "endOfLine": "lf", "plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-classnames"] }Steps to reproduce
prettier-plugin-classnameswithprettier-plugin-tailwindcssin a projectThe current behavior
When saving a file with "format on save" enabled in WebStorm, the editor scroll position jumps to the top of the file after formatting completes. This happens only when
prettier-plugin-classnamesis active - removing the plugin from the configuration resolves the scroll issue. The plugin works correctly (formats classNames), but causes this scroll position reset.The expected behavior
The scroll position should remain at the current location after formatting, maintaining the developer's view of the code they're working on. This is the default behavior when using Prettier without this plugin or with only
prettier-plugin-tailwindcss.