• Java 62.3%
  • TypeScript 36.1%
  • JavaScript 1.2%
  • CSS 0.3%
  • MDX 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jordan Kiesel efac7313d4
Publish
- prettier-plugin-java@2.9.2
2026-05-17 10:41:00 -06:00
.github build(deps): bump actions/upload-pages-artifact from 4 to 5 2026-04-17 09:24:59 +00:00
.husky chore: update dependencies 2024-11-03 21:18:43 -07:00
benchmark chore: clean up and update devDependencies 2026-03-21 16:42:58 -06:00
docs chore: flatten repo and update changelog 2026-03-13 23:41:07 -06:00
logo chore: create SVG logos 2023-08-15 22:23:10 +02:00
scripts build: make tree-sitter-java a build dependency rather than runtime 2026-03-23 22:04:27 -06:00
src fix: restore space between array type and dimension annotations 2026-05-17 10:38:11 -06:00
test fix: restore space between array type and dimension annotations 2026-05-17 10:38:11 -06:00
test-samples chore: flatten repo and update changelog 2026-03-13 23:41:07 -06:00
website build(deps): bump @babel/plugin-transform-modules-systemjs in /website 2026-05-09 20:21:28 -06:00
.gitignore chore: flatten repo and update changelog 2026-03-13 23:41:07 -06:00
.mocharc.json chore: clean up and update devDependencies 2026-03-21 16:42:58 -06:00
.prettierignore build: replace dts-tree-sitter with custom node type generator script 2026-03-16 22:08:58 -06:00
.prettierrc.yaml chore: update to Prettier 2 2020-03-26 10:39:39 +01:00
CHANGELOG.md chore: update changelog 2026-05-17 10:40:38 -06:00
CODE_OF_CONDUCT.md Fix COC formatting. 2019-01-15 19:25:51 +02:00
CONTRIBUTING.md chore: flatten repo and update changelog 2026-03-13 23:41:07 -06:00
eslint.config.js chore: clean up and update devDependencies 2026-03-21 16:42:58 -06:00
lerna.json build: fix Lerna config 2026-05-16 17:13:40 -06:00
LICENSE Update copyright headers 2025-12-31 02:04:44 +00:00
NOTICE Update copyright headers 2025-12-31 02:04:44 +00:00
package.json Publish 2026-05-17 10:41:00 -06:00
README.md chore: flatten repo and update changelog 2026-03-13 23:41:07 -06:00
tsconfig.json chore: remove non-type-checking options from tsconfig.json 2026-05-09 23:14:37 -06:00
tsdown.config.ts feat: support cjs (#804) 2026-03-18 21:46:12 -06:00
yarn.lock Merge pull request #876 from jhipster/dependabot/npm_and_yarn/types/node-25.8.0 2026-05-15 16:42:07 +01:00

Prettier Java Banner

Prettier Java Plugin

CI Status npm version weekly downloads from npm code style: prettier

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.

This plugin adds support for the Java language to Prettier.

Input

public class HelloWorld {
public static void main(String[] args) {System.out.println("Hello World!");;;;;}

@Override
public String toString() {
  return "Hello World";
}
  public int sum(int argument1,int argument2,int argument3,int argument4,int argument5
  ) {
    return argument1+argument2+ argument3 +argument4  + argument5;
  }
}

Output

public class HelloWorld {

  public static void main(String[] args) {
    System.out.println("Hello World!");
  }

  @Override
  public String toString() {
    return "Hello World";
  }

  public int sum(
    int argument1,
    int argument2,
    int argument3,
    int argument4,
    int argument5
  ) {
    return argument1 + argument2 + argument3 + argument4 + argument5;
  }
}

Playground

You can give the plugin a try in our playground!

Getting Started

Installation

npm:

npm install --save-dev --save-exact prettier prettier-plugin-java

Yarn:

yarn add --dev --exact prettier prettier-plugin-java

Usage

npm:

npx prettier --plugin=prettier-plugin-java --write "**/*.java"

Yarn:

yarn exec prettier --plugin=prettier-plugin-java --write "**/*.java"

Integration

Contributing

See CONTRIBUTING.md.