mj-pa is an opinionated config package that extends Prettier. It is tailored to format JS, JSON, & JSX code in a React- or Vue-based environment.
MIT License
Bot releases are visible (Hide)
Full Changelog: https://github.com/killshot13/mj-pa/compare/v2.0.0...v3.0.0
Published by killshot13 about 3 years ago
Summary
reduced the value of
printWidth
from90
to85
increased the value of
tabWidth
from1
to2
adjusted the value of
trailingComma
fromes5
toall
(NOTE: THE ABOVE IS A BREAKING CHANGE THAT MAY REQUIRE ADDITIONAL CONFIGURATION NOT PREVIOUSLY NEEDED!)replaced the now deprecated
jsxBracketSpacing
option with the newbracketSpacing.
adjusted the value of
arrowParens
fromavoid
toalways
improved overall aesthetics and functionality of the
mj-pa
formatting config
1.) 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.
2.) The tab indent modification is an opinionated decision that should improve overall readability and adhere more closely to the accepted standards. While mj-pa
prefers tabs over spaces, to the naked eye at least, this change achieves a nearly identical view compared to a four-space indent.
3.) The trailing comma rule update was admittedly overdue. To continue using es5
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.
IMPORTANT!
Please note that 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).
4.) 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 the jsxBracketSameLine
odocumeption, which was deprecated in Prettier v2.4.0 in favor of the broader bracketSameLine.
The formatted output is nearly identical anyway.
5.) Since becoming more familiar with arrrow 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.
That is all for now :)
Full Changelog: https://github.com/killshot13/mj-pa/compare/v1.3.1...v2.0.0
Published by killshot13 over 3 years ago
index.json
file has become the .prettierrc.json
file. Prettier uses cosmiconfig
for configuration file support. This means you can configure Prettier via (in order of precedence), with the .prettierrc.json
conveniently in the middle of the five available options. The others include .prettierrc
, package.json
& prettier.config.js
.mj-pa
can now be called from the command line. When using Prettier on the command line, you can now point to mj-pa
as your configuration of choice. Config options:--config <path> # Path to a Prettier configuration file
That is all for now :)
Full Changelog: https://github.com/killshot13/mj-pa/compare/v1.2.0...1.3.0
Published by killshot13 almost 4 years ago
Added the ("parser": "typescript") parameter, which favors the typescript parser (via @typescript-eslint/typescript-estree) over traditional babel parser (via @babel/parser). This is somewhat of a personal preference, but also a nod to eslint
, which holds the top spot in overall popularity over other javascript
linters.
The jsxSingleQuote
parameter was changed from false
to true
. This decision was based primarily on user feedback which heavily favored not using quotation marks when defining jsx
classes. It also looks less bulky, which is consistent with the overall intent of mj-pa
.
Changed the ("endOfLine") parameter from auto
to lf
. 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 the auto
setting; which carries the obvious risk of allowing mixed line endings in any shared git repository.
That is all for now :)
Full Changelog: https://github.com/killshot13/mj-pa/compare/v1.0.0...v1.2.0
Published by killshot13 almost 4 years ago
Published to the Node Package Manager Registry on 21 October 2020
Full Changelog: https://github.com/killshot13/mj-pa/commits/v1.0.0