Skip to content

nx format:write --files= does not use Prettier plugins #35823

@garrettadamsss

Description

@garrettadamsss

Current Behavior

Using the --files arg determines allowed extensions with prettier.getSupportInfo() without loading Prettier plugins. In my case, I need the prettier-plugin-svelte plugin to format .svelte files. Instead I am forced to use the prettier --write {files}. Also a warning/error would be nice for file extensions not supported or forward the error from Prettier.

Same closed issue: #21250

Expected Behavior

nx format with the --files arg should use Prettier's plugins for non default extension support.

GitHub Repo

No response

Steps to Reproduce

  1. Create a "something.svelte" file with formatting issues.
  2. Install prettier-plugin-svelte prettier plugin.
  3. Run nx format --files={something.svelte}.
  4. The svelte file will not be processed, no change in diff file.

Nx Report

Node           : 22.15.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 10.32.1

nx (global)        : 21.1.2
nx                 : 22.2.3
@nx/js             : 22.2.3
@nx/eslint         : 22.2.3
@nx/workspace      : 22.2.3
@nx/devkit         : 22.2.3
@nx/esbuild        : 22.2.3
@nx/eslint-plugin  : 22.2.3
@nx/node           : 22.2.3
@nx/playwright     : 22.2.3
@nx/plugin         : 22.2.3
@nx/react          : 22.2.3
@nx/rollup         : 22.2.3
@nx/vite           : 22.2.3
@nx/vitest         : 22.2.3
@nx/web            : 22.2.3
@nx/webpack        : 22.2.3
typescript         : 5.9.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/playwright/plugin
---------------------------------------
Community plugins:
@nxext/svelte    : 18.0.0
@nxext/sveltekit : 18.0.0
nx-stylelint     : 17.1.1
---------------------------------------
Local workspace plugins:
@ctv/compile-time-config
---------------------------------------
Cache Usage: 1.38 MB / 46.04 GB
---------------------------------------

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions