We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This PR adds Prettier to the Maven plugin.
The only limitation (which is also for the Gradle plugin, is that Spotless uses J2V8. As development for J2V8 for non android envs is stopped (for Windows since J2V8 4.6.0 and Unix 4.8.0), therefore Prettier is limited to <= v1.19.0 as newer versions use ES6 feature and that would need a newer J2V8 version.
Please make sure that your PR allows edits from maintainers. Sometimes its faster for us to just fix something than it is to describe how to fix it.
After creating the PR, please add a commit that adds a bullet-point under the -SNAPSHOT section of plugin-maven/CHANGES.md which includes:
-SNAPSHOT
If your change only affects a build plugin, and not the lib, then you only need to update the CHANGES.md for that plugin.
CHANGES.md
If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and the build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.
This makes it easier for the maintainers to quickly release your changes :)
Sorry, something went wrong.
Add prettier to maven plugin
abe3caf
Add prettier to maven plugin Docs change
78ad914
Add prettier to maven plugin spotless apply
9ba42f8
Add prettier to maven plugin spotless apply doc update
f4b3e16
Happy eastern :-)
Link to the issue stating the discontinuation of J2V8 for non android envs: eclipsesource/J2V8#279
try to fix build in CI
c8b14be
2148549
delete accidentally committed file
9b1ac00
doc update
73db418
fix
525f398
214a25c
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thanks very much! I made some comments. If you get stuck fixing the tests let me know and I will try to take a look.
addressed review comments
5a2926d
Thx for the comments, I think I addressed all. Still fighting with the failing build, as that does not happen locally.
re-add deleted line in doc
7d59454
update copyright date in new files
550532d
spotless apply
ef591ef
Hey finally green... and I don't think I committed anything to fix that ;)
3e3c969
Published in plugin-maven 1.30.0
in the docs
Specify either simple prettier version (1.19.0 is max supported, which is also default) or whole devDependencies
But it looks to me like our default is actually 1.16.4
1.16.4
spotless/lib/src/main/java/com/diffplug/spotless/npm/PrettierFormatterStep.java
Lines 40 to 42 in 608af5c
Did you perhaps mean to commit something that didn't make it? Also, wanted to double-check that 1.19.0 is really the max supported, was that what you found in testing? See #556
1.19.0
@nedtwigg Oh yes, good spot. That's a leftover in the doc from a point, where I wanted to up the default to max supported. But I decided against this to not change existing behaviour for people using the gradle plugin and keep it in sync with that.
1.19.0 is in fact the last prettier version working with current spotless. As explained, that is due to the used J2V8. The newer prettier from version 2.0.0 uses ES6 features in the JS, e.g. (...args). J2V8 can't use that and errors then, showing something like:
com.eclipsesource.v8.V8ScriptExecutionException: C:\Users\XYZ\AppData\Local\Temp\junit5133972595801156893\target\spotless-node-modules-prettier-format\node_modules\prettier\index.js:1938: SyntaxError: Unexpected token ...
I decided against this to not change existing behaviour for people using the gradle plugin and keep it in sync with that.
Roger. No obligation to fix, but just FYI, our policy on default versions is that we always bump the default to latest and note it in the changelog. New users of Spotless get the best formatters available, existing users of Spotless who prefer the old version can easily pin it.
We don't have any formal system for finding new versions either, it's just if somebody is working on that component or bothers to make a PR.
nedtwigg nedtwigg requested changes
Successfully merging this pull request may close these issues.