Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prettier standalone + prettier-plugin-java

Minimal browser example for formatting Java with Prettier standalone.

Run

npm install
npm run build
npm start

Or open index.html after npm run build.

Important part

import * as prettier from "prettier/standalone";
import prettierPluginJava from "prettier-plugin-java";

const formatted = await prettier.format(source, {
  parser: "java",
  plugins: [prettierPluginJava],
});

With prettier/standalone, plugins are not loaded automatically. You must import the plugin and pass it in plugins.

CSP-like check

npm run start:csp-like

This runs the bundle with string code generation disabled.

About

Minimal browser example for using prettier-plugin-java with prettier/standalone

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages