All Projects → jhipster → Prettier Java

jhipster / Prettier Java

Licence: apache-2.0
Prettier Java Plugin

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Prettier Java

node-boilerplate
Node Typescript Boilerplate for Microservices. Skeleton for Node.js Apps written in TypeScript (with Setup Instructions for ESLint, Prettier, and Husky)
Stars: ✭ 92 (-84.97%)
Mutual labels:  prettier
Prettier Eslint
Code ➡️ prettier ➡️ eslint --fix ➡️ Formatted Code ✨
Stars: ✭ 3,435 (+461.27%)
Mutual labels:  prettier
React 2048 Game
🎮 A fancy 2048 game build with react, redux best practices.
Stars: ✭ 401 (-34.48%)
Mutual labels:  prettier
SENT-template
Skip setup and start code with SENT (Sapper Express Node Template) and other tools
Stars: ✭ 69 (-88.73%)
Mutual labels:  prettier
Expo Netflix
Netflix UI Clone with React Native & Expo || web support => https://expo-netflix.vercel.app
Stars: ✭ 297 (-51.47%)
Mutual labels:  prettier
Webpack React Boilerplate
Minimal React 16 and Webpack 4 boilerplate with babel 7, using the new webpack-dev-server, react-hot-loader, CSS-Modules
Stars: ✭ 358 (-41.5%)
Mutual labels:  prettier
create-react-typescript-app
Integrating Reactjs with Typescript + ESLint
Stars: ✭ 20 (-96.73%)
Mutual labels:  prettier
React Typescript Web Extension Starter
🖥 A Web Extension starter kit built with React, TypeScript, SCSS, Storybook, Jest, EsLint, Prettier, Webpack and Bootstrap. Supports Google Chrome + Mozilla Firefox + Brave Browser 🔥
Stars: ✭ 510 (-16.67%)
Mutual labels:  prettier
Web Configs
Common configurations for building web apps at Shopify
Stars: ✭ 302 (-50.65%)
Mutual labels:  prettier
Mxstbr.com
The source for my personal website
Stars: ✭ 370 (-39.54%)
Mutual labels:  prettier
Plugin Swift
Prettier Swift Plugin - WARNING: The AST parser is not stable yet
Stars: ✭ 272 (-55.56%)
Mutual labels:  prettier
Coc Prettier
Prettier extension for coc.nvim.
Stars: ✭ 270 (-55.88%)
Mutual labels:  prettier
Apollo Upload Examples
A full stack demo of file uploads via GraphQL mutations using Apollo Server and apollo-upload-client.
Stars: ✭ 358 (-41.5%)
Mutual labels:  prettier
happy-web
Project built during Rocketseat's Next Level Week #3
Stars: ✭ 19 (-96.9%)
Mutual labels:  prettier
Vue Skeleton Mvp
VueJs, Vuetify, Vue Router and Vuex skeleton MVP written on JavaScript using async/await built to work with API REST skeleton: https://github.com/davellanedam/node-express-mongodb-jwt-rest-api-skeleton
Stars: ✭ 406 (-33.66%)
Mutual labels:  prettier
nest-boilerplate
Nest.js boilerplate with CircleCI, Commitizen, Commitlint, Docker-Compose, ESLint, GitHub Actions, Husky, Lint-staged, OpenAPI, Prettier, PostGreSQL, Travis CI, TypeORM
Stars: ✭ 16 (-97.39%)
Mutual labels:  prettier
Sublimejsprettier
JsPrettier is a Sublime Text Plug-in for Prettier, the opinionated code formatter.
Stars: ✭ 355 (-41.99%)
Mutual labels:  prettier
Plugin Python
Prettier Python Plugin
Stars: ✭ 511 (-16.5%)
Mutual labels:  prettier
Prettier Eslint Cli
CLI for prettier-eslint
Stars: ✭ 451 (-26.31%)
Mutual labels:  prettier
Nodejs Api Boilerplate
A boilerplate for kickstart your nodejs api project with JWT Auth and some new Techs :)
Stars: ✭ 364 (-40.52%)
Mutual labels:  prettier

Github Actions Build Status

Prettier Java

Prettier-java Banner

Intro

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.

How it works

A Prettier plugin must first parse the source code of the target language into a traversable data structure (Usually an Abstract Syntax Tree) and then print out that data structure in a "pretty" style.

Prettier-Java uses a Java-Parser implemented in JavaScript using the Chevrotain Parser Building Toolkit for JavaScript. What this means is that unlike many other Prettier plugins, prettier-java has no additional runtime pre-requisites (e.g: Python executable). It could even be used inside a browser.

Subpackages

This project contains 2 packages:

Install

Pre-requirements

Install Prettier and Prettier-Java plugin

# Local installation
npm install prettier-plugin-java --save-dev

# Or globally
npm install -g prettier prettier-plugin-java

or with yarn:

# Local installation
yarn add prettier-plugin-java --dev

# Or globally
yarn global add prettier prettier-plugin-java

Note: If you want to install the prettier-plugin-java globally, you should also install the prettier package globally.

Usage

To reformat all your Java files, run:

# If you have installed the package locally
npx prettier --write "**/*.java"

# Or globally
prettier --write "**/*.java"

To see an advanced usage: please go to the Advanced Usage section

Maven plugin

A neat maven plugin for prettier-java was made by developers from HubSpot.
Add it to the plugins section of your build configuration

<build>
  <plugins>
    <plugin>
      <groupId>com.hubspot.maven.plugins</groupId>
        <artifactId>prettier-maven-plugin</artifactId>
        <!-- Find the latest version at https://github.com/jhipster/prettier-java/releases -->
        <version>0.8</version>
    </plugin>
  </plugins>
</build>

If you would like to use this plugin, we recommend you to check their project as is it well documented.

Organize imports

Prettier-java is currently sorting imports according to the Google Java Style guide.

If you are using an IDE such as IntelliJ, you might want to configure it to match with Prettier-java.

For IntelliJ, you can use this configuration: IntelliJ config

Contributing

Contributions are very welcome. See the contribution guide to get started. And the Help Wanted issues.

Credits

Special thanks to @thorbenvh8 for creating the original prettier-java plugin and the associated Java Parser implemented in JavaScript.

We would also like to thank the Chevrotain and Prettier contributors which made this possible.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].