prettier-elastic

Prettier (code formatter) with customized formatting rules

MIT 74 个版本
安装
npm install prettier-elastic
yarn add prettier-elastic
pnpm add prettier-elastic
bun add prettier-elastic
README

prettier-elastic

Fork of a Prettier tweaked to provide alternative formatting for var, let and const declarations and other improvements

Installation

$ npm install prettier-elastic

Usage

var prettier = require("prettier-elastic");

// Same as with original prettier
prettier.format(src, options);

Examples

prettierprettier-elastic
var eloBar = require("elo-bar"),
  foo = require("foo"),
  otherThing = require("other-thing");
var eloBar     = require("elo-bar")
  , foo        = require("foo")
  , otherThing = require("other-thing");
const eloBar = require("elo-bar"),
  foo = require("foo"),
  otherThing = require("other-thing");
const eloBar     = require("elo-bar")
    , foo        = require("foo")
    , otherThing = require("other-thing");

Test

$ npm test

Prettier Banner

Opinionated Code Formatter

JavaScript · TypeScript · Flow · JSX · JSON
CSS · SCSS · Less
HTML · Vue · Angular
GraphQL · Markdown · YAML
Your favorite language?

Github Actions Build Status Github Actions Build Status Github Actions Build Status Codecov Coverage Status Blazing Fast
npm version weekly downloads from npm Follow Prettier on Twitter

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.

Input

foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());

Output

foo(
  reallyLongArg(),
  omgSoManyParameters(),
  IShouldRefactorThis(),
  isThereSeriouslyAnotherOne(),
);

Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!


Documentation

Install · Options · CLI · API

Playground


Badge

Show the world you're using Prettier

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Contributing

See CONTRIBUTING.md.

版本列表
3.2.5 2024-02-18
3.2.4 2024-02-18
3.2.3 2024-02-18
3.2.2 2024-02-17
3.2.1 2024-02-17
3.2.0 2024-02-17
3.1.1 2024-02-16
3.1.0 2024-02-16
3.0.3 2024-02-15
3.0.2 2024-02-15
3.0.1 2024-02-15
3.0.0 2024-02-15
2.8.8 2024-01-04
2.8.7 2024-01-04
2.8.6 2024-01-04
2.8.5 2024-01-04
2.8.4 2024-01-04
2.8.3 2024-01-04
2.8.2 2024-01-04
2.8.1 2024-01-04
2.8.0 2024-01-04
2.7.1 2024-01-04
2.7.0 2024-01-04
2.6.2 2024-01-03
2.6.1 2024-01-02
2.6.0 2024-01-02
2.5.1 2023-12-13
2.5.0 2023-12-13
2.4.1 2023-12-13
2.4.0 2023-12-11
2.3.2 2023-12-08
2.3.1 2023-12-08
2.3.0 2023-12-07
2.2.1 2021-05-07
2.2.0 2021-05-07
2.1.2 2020-11-16
2.1.1 2020-11-16
2.1.0 2020-11-16
2.0.5 2020-09-29
2.0.4 2020-09-29
2.0.3 2020-09-29
2.0.2 2020-09-29
2.0.1 2020-09-29
2.0.0 2020-09-29
1.19.1 2019-12-09
1.19.0 2019-12-09
1.18.2 2019-06-10
1.18.1 2019-06-10
1.18.0 2019-06-10
1.17.1 2019-06-10
1.17.0 2019-04-17
1.16.4 2019-02-18
1.16.3 2019-02-01
1.16.2 2019-02-01
1.16.1 2019-02-01
1.16.0 2019-02-01
1.15.3 2019-01-31
1.15.2 2019-01-31
1.15.1 2019-01-31
1.15.0 2019-01-31
1.14.3 2019-01-31
1.14.2 2018-09-07
1.14.1 2018-09-06
1.14.0 2018-08-06
1.13.7 2018-08-06
1.13.6 2018-08-06
1.13.5 2018-08-06
1.13.4 2018-08-06
1.13.3 2018-08-06
1.13.2 2018-05-29
1.13.1 2018-05-29
1.13.0 2018-05-29
1.12.1 2018-04-26
1.12.0 2018-04-16