All notable changes to mj-pa will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
(2023-10-24)
View it on npm or test it on RunKit.
- Support was added for the new
singleAttributePerLine
option with the value set totrue
.
- Improvements were made to the overall aesthetics and functionality.
-
All options that simply repeated the Prettier default values based on [Prettier v3.0.0] were removed. See the complete list below. ⬇️
ATTENTION: THIS IS A BREAKING CHANGE; UPDATE WITH CAUTION!
{
"tabWidth": 2,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf",
"embeddedLanguageFormatting": "auto"
}
(2021-09-25)
View it on npm or test it on RunKit.
- The
bracketSameLine
option replaces the now deprecatedjsxBracketSameLine
. Since this release is already going to throw rocks at glass houses with the trailing comma rule change, there was no reason to continue supporting thejsxBracketSameLine
option, which was deprecated in Prettier v2.4.0 in favor of the broaderbracketSameLine.
The formatted output is nearly identical anyway.
-
The value of
printWidth
has been reduced from from90
to85
. The new print width addresses an issue on small & mid-size devices where a 90-char line would extend beyond the visible right margin of the editor, particularly VS Code if the IDE settings are such that both the Activity Bar and File Minimap are rendered on the right-hand side of the editor. -
The value of
tabWidth
has been increased from1
to2
. The tab indent modification is an opinionated decision that should improve overall readability and adhere more closely to the accepted standards. Whilemj-pa
prefers tabs over spaces, to the naked eye at least, this change achieves a nearly identical view compared to a four-space indent. -
The value of
trailingComma
has been switched fromes5
toall
This update was admittedly overdue. To continue usinges5
conventions would have been laughable, and although my styling is arguably rather opinionated, even I am not bold enough to suggest dropping the trailing comma. Since only one option remained, the change was implemented by default. However, this a breaking change, and therefore a major version update (v2.0.0) was introduced.ATTENTION: THIS IS A BREAKING CHANGE; UPDATE WITH CAUTION!
NOTE: To run, JavaScript code formatted this way needs an engine that supports ES2017 (Node.js 8+ or a modern browser) or downlevel compilation. This also enables trailing commas in type parameters in TypeScript (supported since TypeScript 2.7 was released in January 2018).
-
The value of
arrowParens
has been transitioned fromavoid
toalways
. Since becoming more familiar with arrow functions and type annotations, I can no longer justify my previous support for avoiding parentheses to minimize noise. In the documentation, the authors of Prettier note that a consistent use of parentheses provides a better experience when editing authentic codebases, and I agree.
- Overall aesthetics and functionality of the
mj-pa
formatting config have been improved.
(2021-05-09)
View it on npm or test it on RunKit.
- New file
codeql-analysis.yml
by @killshot13 in #1
- The
index.json
file has become the.prettier.json
file.
NOTE: Prettier uses cosmiconfig
for configuration file support. This means you can configure Prettier in five different ways, with the .prettierrc.json
conveniently in the middle of the available options.
- Update issue templates by @killshot13 in #2
- The
mj-pa
config is now callable from the command line; when using Prettier on the command line, you can now point tomj-pa
as your configuration of choice
Additional config alternatives include .prettierrc, package.json, and prettier.config.js
# Path to a Prettier configuration file
--config ./mj-pa/.prettierrc.json
- [ImgBot] Optimize images by @imgbot in #3
- Better overall integration and flexibility achieved
(2020-12-23)
View it on npm or test it on RunKit.
-
mj-pa
now defines a value forparser
in.prettierrc.json
. This decision favors the typescript parser over the more traditional babel parser. While somewhat of a personal preference, this is also a nod toeslint
, which holds the top spot in overall popularity over otherjavascript
linters.{ "parser": "typescript" }
-
The
jsxSingleQuote
parameter was changed fromfalse
totrue
. This decision was based primarily on user feedback, which heavily favored not using quotation marks when definingjsx
classes. It also looks less bulky, which is consistent with the generally minimalist approach ofmj-pa
.{ "jsxSingleQuote": true }
-
The
endOfLine
option changed fromauto
tolf
. With the exponential increase in popularity for Linux-based development since Microsoft released WSL2 (Windows Subsystem for Linux v2), there is no longer much justification left for theauto
setting, which carries the obvious risk of allowing mixed line endings in any shared git repository.{ "endOfLine": "lf" }
- This version was published both to npm and the Github package registry!
(2020-10-21)
View it on npm or test it on RunKit.
- Initial publication to the Node Package Manager (npm) registry.