Skip to content

Add @fluent/prettier-plugin package to autoformat Fluent resources#668

Open
wbolster wants to merge 1 commit into
projectfluent:mainfrom
wbolster:prettier-plugin
Open

Add @fluent/prettier-plugin package to autoformat Fluent resources#668
wbolster wants to merge 1 commit into
projectfluent:mainfrom
wbolster:prettier-plugin

Conversation

@wbolster

@wbolster wbolster commented Jun 8, 2026

Copy link
Copy Markdown

This adds a @fluent/prettier-plugin subpackage containing a Prettier plugin to autoformat FTL resource files. See added README for details.

The packaging, metadata, license, documentation, etc. follows the conventions used by the the other packages in this monorepo. The package is not included in the typedoc docs, because it is not intended to be used as a library, but indirectly via Prettier as a plugin.

The vitest configuration now also runs tests written in TypeScript, and @types/node is added as dev dependency, because it gets referenced from tsconfig.

Closes #667.

@wbolster

wbolster commented Jun 8, 2026

Copy link
Copy Markdown
Author

hi @eemeli, please have a look!

i tried to follow project conventions as much as possible. all tests and packaging pass locally, and also in github actions in my own fork.

note that i chose 0.1.0 as the version number, and the changelog (which i presume is maintained manually?) reflects that.

@wbolster

wbolster commented Jun 8, 2026

Copy link
Copy Markdown
Author

fwiw, here's a direct link to the readme, which makes it easier to read: https://github.com/wbolster/fluent.js/blob/prettier-plugin/fluent-prettier-plugin/README.md

@wbolster

wbolster commented Jun 8, 2026

Copy link
Copy Markdown
Author

paging @Demivan (oh hi 👋🏼) b/c this prettier plugin enhances fluent-vue with formatting inside <fluent> SFC blocks

@wbolster

wbolster commented Jun 8, 2026

Copy link
Copy Markdown
Author

the prettier docs about plugin development may be useful for reviewers. @fluent/prettier-plugin strictly follows the official guidelines, without hacks or anything, so this should just keep working as the prettier API has proven to be pretty (🙃) stable over time.

This adds a @fluent/prettier-plugin subpackage containing a Prettier
plugin to autoformat FTL resource files. See added README for details.

The packaging, metadata, license, documentation, etc. follows the
conventions used by the the other packages in this monorepo. The
package is not included in the typedoc docs, because it is not
intended to be used as a library, but indirectly via Prettier as a
plugin.

The vitest configuration now also runs tests written in TypeScript,
and @types/node is added as dev dependency, because it gets referenced
from tsconfig.

Closes projectfluent#667.

@eemeli eemeli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hold off on jumping to a solution right away -- it's only been a few days since the discussion on this even started. As I mention in #667 (comment), we should work towards having just one Prettier plugin for Fluent.

One additional reason I'd prefer to have @luca-iachini on board with the work here is to ensure that any new code we might add to this repo will also be maintained, and that's always easier with multiple maintainers.

@wbolster

wbolster commented Jun 9, 2026

Copy link
Copy Markdown
Author

sure, to keep the discussion centralized i've answered here: #667 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autoformatting using a prettier plugin

2 participants