
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
prettier-plugin-brace-style
Advanced tools
A Prettier plugin that can apply ESLint's brace-style rules.
A Prettier plugin that can apply ESLint's brace-style rules.
npm install -D prettier prettier-plugin-brace-style
JSON example:
{
"plugins": ["prettier-plugin-brace-style"]
}
JS example (CommonJS module):
module.exports = {
plugins: ['prettier-plugin-brace-style'],
braceStyle: 'stroustrup',
};
JS example (ES module):
export default {
plugins: ['prettier-plugin-brace-style'],
braceStyle: 'allman',
};
Enforces consistent brace style for blocks. Same as ESLint, you can select one of 1tbs
(default), stroustrup
, allman
.
1tbs
example:
if (condition) {
statement1;
} else {
statement2;
}
stroustrup
example:
if (condition) {
statement1;
}
else {
statement2;
}
allman
example:
if (condition)
{
statement1;
}
else
{
statement2;
}
Default | CLI Override | API Override |
---|---|---|
"1tbs" | --brace-style <1tbs|stroustrup|allman> | braceStyle: "<1tbs|stroustrup|allman>" |
Starting with 0.6.0
, when there is a minor release on one side, I plan to reflect that change on the other side as well if possible.
If more than one Prettier plugin can handle the text you want to format, Prettier will only use the last of those plugins.
In this case, you can configure it as follows by adding prettier-plugin-merge to apply those plugins sequentially.
JSON example:
{
"plugins": [
"@trivago/prettier-plugin-sort-imports",
"prettier-plugin-brace-style",
"prettier-plugin-merge"
],
"braceStyle": "stroustrup"
}
If your version of prettier-plugin-brace-style
is less than 0.5.0
, you will also need to install @prettier/sync
. ↩
FAQs
A Prettier plugin that can apply ESLint's brace-style rules.
The npm package prettier-plugin-brace-style receives a total of 9,854 weekly downloads. As such, prettier-plugin-brace-style popularity was classified as popular.
We found that prettier-plugin-brace-style demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.