prettier 0.20.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +120 -5
  3. data/CONTRIBUTING.md +8 -6
  4. data/README.md +67 -60
  5. data/node_modules/prettier/bin-prettier.js +181 -148
  6. data/node_modules/prettier/index.js +10335 -7465
  7. data/node_modules/prettier/third-party.js +33 -140
  8. data/package.json +9 -6
  9. data/src/embed.js +27 -8
  10. data/src/nodes.js +6 -2
  11. data/src/nodes/alias.js +65 -24
  12. data/src/nodes/aref.js +55 -0
  13. data/src/nodes/args.js +55 -47
  14. data/src/nodes/arrays.js +150 -137
  15. data/src/nodes/assign.js +32 -32
  16. data/src/nodes/blocks.js +8 -3
  17. data/src/nodes/calls.js +158 -70
  18. data/src/nodes/case.js +11 -7
  19. data/src/nodes/class.js +74 -0
  20. data/src/nodes/commands.js +36 -31
  21. data/src/nodes/conditionals.js +48 -46
  22. data/src/nodes/constants.js +39 -21
  23. data/src/nodes/flow.js +45 -17
  24. data/src/nodes/hashes.js +121 -117
  25. data/src/nodes/heredocs.js +34 -0
  26. data/src/nodes/hooks.js +36 -7
  27. data/src/nodes/ints.js +27 -20
  28. data/src/nodes/lambdas.js +69 -52
  29. data/src/nodes/loops.js +19 -29
  30. data/src/nodes/massign.js +87 -65
  31. data/src/nodes/methods.js +48 -73
  32. data/src/nodes/operators.js +70 -39
  33. data/src/nodes/params.js +26 -16
  34. data/src/nodes/patterns.js +108 -33
  35. data/src/nodes/regexp.js +45 -14
  36. data/src/nodes/rescue.js +72 -59
  37. data/src/nodes/statements.js +86 -44
  38. data/src/nodes/strings.js +95 -91
  39. data/src/nodes/super.js +35 -0
  40. data/src/nodes/undef.js +42 -0
  41. data/src/parser.js +86 -0
  42. data/src/parser.rb +2567 -0
  43. data/src/printer.js +90 -0
  44. data/src/ruby.js +20 -42
  45. data/src/toProc.js +4 -4
  46. data/src/utils.js +24 -88
  47. data/src/utils/inlineEnsureParens.js +42 -0
  48. data/src/utils/isEmptyStmts.js +7 -0
  49. data/src/utils/literalLineNoBreak.js +7 -0
  50. metadata +15 -50
  51. data/src/nodes/scopes.js +0 -61
  52. data/src/parse.js +0 -37
  53. data/src/print.js +0 -23
  54. data/src/ripper.rb +0 -811
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aea7d57eff37033c3a0eee6a2af5e1a81b2670095a53ab00614851e80f179325
4
- data.tar.gz: 0d1d8f7d4fb0d66b34001c21dc1bc513fc91e3ecacd6424a13f8a627e812ddbd
3
+ metadata.gz: 1738251faac58ab78438da2dcf568a86708d1ccb651d7ec593f0e3c3efc5075a
4
+ data.tar.gz: 91666c89e8846d9a908883339238dfec94816adb14c8949fe9232590e493c48b
5
5
  SHA512:
6
- metadata.gz: 9ac99f694d42d809458f849037893d1bb4fac4c01cc50345b87ffd96acf2fa38780f6c1b60bd2c73a661f0c1334121cafda34b19390db3ea9a241684f59e4be5
7
- data.tar.gz: c6546bc8fbb4b061317a98aec78a14337bf05356b2e8b343e4f12f1bb2404360efaaa64cbb8aef9b5e1334891d71b8d0bc510eb84a149b62fba69d03c3ac6efd
6
+ metadata.gz: d7df78d09da53ada78d9d9a0d3421e279bc0f1593aaff7a099ef397deea85f4fdde3a044ef91bb88f8f5d6a4f91d52d303e912e60f84b946c35528c0c6f139e1
7
+ data.tar.gz: 95e810fa06b71063a010f8e3e3dd3cf7302e2cf1b3573f8da4b7e7fed9288ecaf4d75cbd6429c4b04dbc31728dc879cf1605c8c104fc130bdbfc30583c837e5b
@@ -6,6 +6,108 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.0] - 2020-12-11
10
+
11
+ ### Changed
12
+
13
+ - [@kddeisz] - Do not unescape double quotes in a single quote string.
14
+ - [@kddeisz] - Only force braces on regexp for spaces and equals if it's inside a command or command_call.
15
+ - [@kddeisz] - Leave Sorbet type annotations in place.
16
+ - [@kddeisz] - Don't group hash contents, just allow them to break with their parent node.
17
+ - [@kddeisz] - Honor the UTF-8 lang passed in through ENV vars.
18
+
19
+ ## [1.0.0-rc2] - 2020-12-10
20
+
21
+ ### Changed
22
+
23
+ - [@kddeisz] - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets).
24
+ - [@kddeisz] - Respect using `o` or not using `o` for octal numbers.
25
+ - [@kddeisz] - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly.
26
+ - [@kddeisz] - Ensure hash literal is split correctly when only its contents would fit on one line.
27
+ - [@kddeisz] - Simplify `toProc` checks by not calling if the option is disabled.
28
+ - [@johncsnyder], [@kddeisz] - Add `method_add_block` to the potential like of method calls that can be chained.
29
+ - [@kddeisz] - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals.
30
+
31
+ ## [1.0.0-rc1] - 2020-12-09
32
+
33
+ ### Changed
34
+
35
+ - [@kddeisz] - Rename options to prep for v1.0 release.
36
+ - `addTrailingCommas` -> `trailingComma`, `"es5"` means `true`
37
+ - `inlineConditionals` and `inlineLoops` -> `rubyModifier`
38
+ - `preferHashLabels` -> `rubyHashLabel`
39
+ - `preferSingleQuotes` -> `rubySingleQuote`
40
+ - `toProcTransform` -> `rubyToProc`
41
+ - [@andyw8], [@kddeisz] - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes.
42
+ - [@andyw8], [@kddeisz] - Fix for plain `rescue` nodes with only comments in the body.
43
+ - [@andyw8], [@kddeisz] - Move declaration-type comments up to the line in the original source, as in:
44
+
45
+ ```ruby
46
+ def foo # :nodoc:
47
+ bar
48
+ end
49
+ ```
50
+
51
+ The comment in the above example should stay in place.
52
+
53
+ - [@janklimo] - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same.
54
+ - [@kddeisz] - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`.
55
+ - [@kddeisz] - Fix up a bug with negative ranges, e.g., `-4..-3`.
56
+ - [@kddeisz] - Fix up a bug with operator aliases, e.g., `alias << push`.
57
+ - [@kddeisz] - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`.
58
+ - [@kddeisz] - Fix up a bug with multiple rescue clauses and comments, e.g.,
59
+
60
+ ```ruby
61
+ begin
62
+
63
+ rescue Foo, Bar
64
+ # comment
65
+ end
66
+ ```
67
+
68
+ - [@kddeisz] - Handle string literals that start with `%Q`.
69
+ - [@kddeisz] - Handle question method methods in the predicate of an if with a comment in the body.
70
+ - [@kddeisz] - Fix bare `break` with comments immediately after.
71
+ - [@kddeisz] - Fix for heredocs with comments immediately after the declaration.
72
+ - [@kddeisz] - Fix for comments when you're defining a method whose name overlaps with a keyword.
73
+ - [@kddeisz] - Don't automatically indent inside interpolated expressions from within a heredoc.
74
+ - [@kddeisz] - Don't convert into string literal arrays if the elements have brackets.
75
+ - [@kddeisz] - Ensure you break the parent when there is an assignment in the predicate of a loop.
76
+ - [@kddeisz] - Fix up a bug with keyword aliases, e.g., `alias in within`.
77
+ - [@kddeisz] - Force using braces for regex if a regex starts with a blank space.
78
+ - [@kddeisz] - Force using braces for regex if a regex starts with an equals sign.
79
+ - [@kddeisz] - Fix up a bug with constant aliases, e.g., `alias in IN`.
80
+ - [@andyw8], [@kddeisz] - Ensure `rescue` comments stay on the same line as their declaration.
81
+
82
+ # [0.22.0] - 2020-12-08
83
+
84
+ ### Changed
85
+
86
+ - [@flyerhzm] - Print method chains by one indentation.
87
+ - [@mmcnl], [@kddeisz] - Handle heredocs and blocks being passed to the same method.
88
+ - [@johncsnyder], [@kddeisz] - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`.
89
+ - [@Rsullivan00] - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses.
90
+ - [@jbielick] - Maintain parse order during if/unless modifier expressions
91
+ - [@flyerhzm] - Slight prettifying of wrapped args if doc length is under a certain value.
92
+ - [@github0013], [@kddeisz] - Ensure `not` keeps parentheses if they are being used.
93
+ - [@jbielick] - Print heredocs consistently.
94
+ - [@kddeisz] - Completely revamp the way we handle comments.
95
+ - [@kddeisz] - Support `hshptn` and the remaining missing pattern matching syntax.
96
+
97
+ ## [0.21.0] - 2020-12-02
98
+
99
+ ### Changed
100
+
101
+ - [@kddeisz], [@ryan-hunter-pc] - Explicitly handle `break` and `next` keyword parentheses.
102
+ - [@jbielick], [@kddeisz] - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can.
103
+ - [@kddeisz] - Turn off the `Symbol#to_proc` transform by default.
104
+ - [@janklimo], [@kddeisz] - Properly handle trailing commas on hash arguments.
105
+ - [@coiti], [@kddeisz] - Properly handle parentheses when necessary on if/unless statements and while/until loops.
106
+ - [@Rsullivan00] - Prevent `command` and `command_call` nodes from being turned into ternaries.
107
+ - [@kddeisz] - Better handling of the `alias` node with and without comments.
108
+ - [@kddeisz] - Better handling of the `BEGIN` and `END` nodes with and without comments.
109
+ - [@kddeisz] - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple.
110
+
9
111
  ## [0.20.1] - 2020-09-04
10
112
 
11
113
  ### Changed
@@ -160,7 +262,8 @@ will now be printed as:
160
262
  ```ruby
161
263
  Config::Download.new(
162
264
  'prettier',
163
- filename: 'prettier.yml', url: 'https://raw.githubusercontent.com/...'
265
+ filename: 'prettier.yml',
266
+ url: 'https://raw.githubusercontent.com/...'
164
267
  ).perform
165
268
  ```
166
269
 
@@ -848,7 +951,12 @@ would previously result in `array[]`, but now prints properly.
848
951
 
849
952
  - Initial release 🎉
850
953
 
851
- [unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.20.1...HEAD
954
+ [unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.0.0...HEAD
955
+ [1.0.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc2...v1.0.0
956
+ [1.0.0-rc2]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc1...v1.0.0-rc2
957
+ [1.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v0.22.0...v1.0.0-rc1
958
+ [0.22.0]: https://github.com/prettier/plugin-ruby/compare/v0.21.0...v0.22.0
959
+ [0.21.0]: https://github.com/prettier/plugin-ruby/compare/v0.20.1...v0.21.0
852
960
  [0.20.1]: https://github.com/prettier/plugin-ruby/compare/v0.20.0...v0.20.1
853
961
  [0.20.0]: https://github.com/prettier/plugin-ruby/compare/v0.19.1...v0.20.0
854
962
  [0.19.1]: https://github.com/prettier/plugin-ruby/compare/v0.19.0...v0.19.1
@@ -899,6 +1007,7 @@ would previously result in `array[]`, but now prints properly.
899
1007
  [@alanfoster]: https://github.com/AlanFoster
900
1008
  [@alse]: https://github.com/alse
901
1009
  [@andrewraycode]: https://github.com/AndrewRayCode
1010
+ [@andyw8]: https://github.com/andyw8
902
1011
  [@ashfurrow]: https://github.com/ashfurrow
903
1012
  [@awinograd]: https://github.com/awinograd
904
1013
  [@bugthing]: https://github.com/bugthing
@@ -906,12 +1015,13 @@ would previously result in `array[]`, but now prints properly.
906
1015
  [@christoomey]: https://github.com/christoomey
907
1016
  [@cldevs]: https://github.com/cldevs
908
1017
  [@codingitwrong]: https://github.com/CodingItWrong
1018
+ [@coiti]: https://github.com/coiti
909
1019
  [@deecewan]: https://github.com/deecewan
910
1020
  [@dudeofawesome]: https://github.com/dudeofawesome
911
1021
  [@eins78]: https://github.com/eins78
912
- [@ftes]: https://github.com/ftes
913
1022
  [@flyerhzm]: https://github.com/flyerhzm
914
1023
  [@fruetel]: https://github.com/Fruetel
1024
+ [@ftes]: https://github.com/ftes
915
1025
  [@gin0606]: https://github.com/gin0606
916
1026
  [@github0013]: https://github.com/github0013
917
1027
  [@glejeune]: https://github.com/glejeune
@@ -920,7 +1030,9 @@ would previously result in `array[]`, but now prints properly.
920
1030
  [@jakeprime]: https://github.com/jakeprime
921
1031
  [@jamescostian]: https://github.com/jamescostian
922
1032
  [@janklimo]: https://github.com/janklimo
1033
+ [@jbielick]: https://github.com/jbielick
923
1034
  [@joeyjoejoejr]: https://github.com/joeyjoejoejr
1035
+ [@johncsnyder]: https://github.com/johncsnyder
924
1036
  [@johnschoeman]: https://github.com/johnschoeman
925
1037
  [@joshuakgoldberg]: https://github.com/JoshuaKGoldberg
926
1038
  [@jpickwell]: https://github.com/jpickwell
@@ -935,15 +1047,18 @@ would previously result in `array[]`, but now prints properly.
935
1047
  [@matt-wratt]: https://github.com/matt-wratt
936
1048
  [@meleyal]: https://github.com/meleyal
937
1049
  [@mmainz]: https://github.com/mmainz
1050
+ [@mmcnl]: https://github.com/mmcnl
938
1051
  [@noahtheduke]: https://github.com/NoahTheDuke
939
1052
  [@overload119]: https://github.com/Overload119
940
1053
  [@petevk]: https://github.com/petevk
941
1054
  [@pje]: https://github.com/pje
942
1055
  [@rosskinsella]: https://github.com/RossKinsella
1056
+ [@rsullivan00]: https://github.com/Rsullivan00
1057
+ [@ryan-hunter-pc]: https://github.com/ryan-hunter-pc
943
1058
  [@shaydavidson]: https://github.com/ShayDavidson
1059
+ [@steobrien]: https://github.com/steobrien
1060
+ [@sviccari]: https://github.com/SViccari
944
1061
  [@tobyndockerill]: https://github.com/tobyndockerill
945
1062
  [@uri]: https://github.com/uri
946
1063
  [@xipgroc]: https://github.com/xipgroc
947
1064
  [@yuki24]: https://github.com/yuki24
948
- [@rsullivan00]: https://github.com/Rsullivan00
949
- [@steobrien]: https://github.com/steobrien
@@ -22,9 +22,9 @@ In order to get printed, the code goes through a couple of transformations. The
22
22
 
23
23
  ### Text to AST
24
24
 
25
- When the prettier process first spins up, it examines which files it's going to print and selects an appropriate plugin for each one. Once selected, it runs that plugin's `parse` function, seen [here](src/parse.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [ripper.rb](src/ripper.rb) with the input code preloaded on stdin.
25
+ When the prettier process first spins up, it examines which files it's going to print and selects an appropriate plugin for each one. Once selected, it runs that plugin's `parse` function, seen [here](src/parser.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [parser.rb](src/parser.rb) with the input code preloaded on stdin.
26
26
 
27
- `ripper.rb` will read the text off of stdin and then feed it to a new `Ripper` instance, which is a Ruby standard library recursive-descent parser. Briefly, the way that `Ripper` works is by tokenizing the input and then matching those tokens against a grammar to form s-expressions. To extend `Ripper`, you overwrite the methods that control how those s-expressions are formed, e.g., to modify the s-expression that is formed when `Ripper` encounters a string literal, you would override the `#on_string_literal` method. Below is an example for seeing that in action.
27
+ `parser.rb` will read the text off of stdin and then feed it to a new `Ripper` instance, which is a Ruby standard library recursive-descent parser. Briefly, the way that `Ripper` works is by tokenizing the input and then matching those tokens against a grammar to form s-expressions. To extend `Ripper`, you overwrite the methods that control how those s-expressions are formed, e.g., to modify the s-expression that is formed when `Ripper` encounters a string literal, you would override the `#on_string_literal` method. Below is an example for seeing that in action.
28
28
 
29
29
  Let's assume you have the following code:
30
30
 
@@ -34,6 +34,7 @@ Let's assume you have the following code:
34
34
 
35
35
  First, `Ripper` will tokenize:
36
36
 
37
+ <!-- prettier-ignore -->
37
38
  ```ruby
38
39
  require 'ripper'
39
40
 
@@ -50,6 +51,7 @@ pp Ripper.lex('1 + 1')
50
51
 
51
52
  You can see it has location metadata (row and column), the token type, the value associated with that token type, and the lexer state when that token was encountered. Then, it will convert those tokens into s-expressions:
52
53
 
54
+ <!-- prettier-ignore -->
53
55
  ```ruby
54
56
  require 'ripper'
55
57
 
@@ -65,11 +67,11 @@ pp Ripper.sexp_raw('1 + 1')
65
67
 
66
68
  As you can see above, the resulting s-expressions will call the following methods in order on the instantiated `Ripper` instance: `on_int`, `on_int`, `on_stmts_new`, `on_binary`, `on_stmts_add`, `on_program`. You can hook into any part of this process by overriding any of those methods (we override all of them).
67
69
 
68
- Now that the text has been transformed into an AST that we can work with, `ripper.rb` will serialize the result to JSON, write it back to stdout, and exit. The `parse` function will then parse that JSON by reading off the child process once it has exited, and return that value back to prettier.
70
+ Now that the text has been transformed into an AST that we can work with, `parser.rb` will serialize the result to JSON, write it back to stdout, and exit. The `parse` function will then parse that JSON by reading off the child process once it has exited, and return that value back to prettier.
69
71
 
70
72
  ### AST to Doc
71
73
 
72
- Once prettier has a working AST, it will take it and call the selected plugin's [`print` function](src/print.js), whose purpose is to convert that AST into prettier's intermediate representation called Docs. It does this by handing the print function a `FastPath` object that keeps track of the state of the printing as it goes, and allows accessing various parts of the AST quickly.
74
+ Once prettier has a working AST, it will take it and call the selected plugin's [`printNode` function](src/printer.js), whose purpose is to convert that AST into prettier's intermediate representation called Docs. It does this by handing the print function a `FastPath` object that keeps track of the state of the printing as it goes, and allows accessing various parts of the AST quickly.
73
75
 
74
76
  Effectively, it walks the AST in the reverse direction from the way `Ripper` built it (top-down instead of bottom-up). The first node that gets passed into the `print` function is the `program` node as that's always on top. Then it is the `program` node's responsibility to recursively call print on its child nodes as it best sees fit.
75
77
 
@@ -127,7 +129,7 @@ In order to support all preferences, the Ruby options need to be distinct from t
127
129
 
128
130
  ### What versions of Ruby are supported?
129
131
 
130
- At the moment, we support back to Ruby 2.5. This is because in Ruby 2.5, Ripper got some additional public methods for accessing lexer state, which is necessary for parsing comments. This is not to say that prettier can't parse and print earlier versions of Ruby, it's just that the Ruby process running prettier (whatever `ruby` resolves to when the process runs) must be >= 2.5.
132
+ We support all Ruby versions that are under security maintenance or better (https://www.ruby-lang.org/en/downloads/branches/). This means at the moment we support back to Ruby 2.5. This is not to say that prettier can't parse and print code that was written while running earlier versions of Ruby, it's just that the Ruby process running prettier (whatever `ruby` resolves to when the process runs) must be >= 2.5.
131
133
 
132
134
  ### Do you support ERB files (.html.erb, .js.erb, etc.)?
133
135
 
@@ -166,8 +168,8 @@ While developing, we've built a couple of small utilities for debugging the `pre
166
168
 
167
169
  - `bin/lex [file|source]` - outputs the tokens as ripper sees them
168
170
  - `bin/sexp [file|source]` - outputs the AST that ripper builds before it gets passed back to `prettier`
171
+ - `bin/pragma [file]` - runs the `hasPragma` function against the given input file
169
172
  - `bin/print [file|source]` - outputs the printed source of a Ruby file after running it through `prettier`
170
- - `bin/has-pragma [file]` - runs the `hasPragma` function against the given input file
171
173
 
172
174
  ## Testing
173
175
 
data/README.md CHANGED
@@ -122,30 +122,31 @@ The `prettier` executable is now installed and ready for use:
122
122
 
123
123
  Below are the options (from [`src/ruby.js`](src/ruby.js)) that `@prettier/plugin-ruby` currently supports:
124
124
 
125
- | API Option | CLI Option | Default | Description |
126
- | -------------------- | ------------------------ | :-----: | ------------------------------------------------------------------------------------------------------------- |
127
- | `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). |
128
- | `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). |
129
- | `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). |
130
- | `addTrailingCommas` | `--add-trailing-commas` | `false` | Adds a trailing comma to array literals, hash literals, and method calls. |
131
- | `inlineConditionals` | `--inline-conditionals` | `true` | When it fits on one line, allows if and unless statements to use the modifier form. |
132
- | `inlineLoops` | `--inline-loops` | `true` | When it fits on one line, allows while and until statements to use the modifier form. |
133
- | `preferHashLabels` | `--prefer-hash-labels` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. |
134
- | `preferSingleQuotes` | `--prefer-single-quotes` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. |
125
+ | API Option | CLI Option | Default | Description |
126
+ | ------------------ | ---------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------ |
127
+ | `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). |
128
+ | `requirePragma` | `--require-pragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)). |
129
+ | `rubyArrayLiteral` | `--ruby-array-literal` | `true` | When possible, favor the use of string and symbol array literals. |
130
+ | `rubyHashLabel` | `--ruby-hash-label` | `true` | When possible, uses the shortened hash key syntax, as opposed to hash rockets. |
131
+ | `rubyModifier` | `--ruby-modifier` | `true` | When it fits on one line, allows while and until statements to use the modifier form. |
132
+ | `rubySingleQuote` | `--ruby-single-quote` | `true` | When double quotes are not necessary for interpolation, prefers the use of single quotes for string literals. |
133
+ | `rubyToProc` | `--ruby-to-proc` | `false` | When possible, convert blocks to the more concise `Symbol#to_proc` syntax. |
134
+ | `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). |
135
+ | `trailingComma` | `--trailing-comma` | `"es5"` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#trailing-comma)). `"es5"` is equivalent to `true`. |
135
136
 
136
137
  Any of these can be added to your existing [prettier configuration
137
138
  file](https://prettier.io/docs/en/configuration.html). For example:
138
139
 
139
140
  ```json
140
141
  {
141
- "preferSingleQuotes": false
142
+ "rubySingleQuote": false
142
143
  }
143
144
  ```
144
145
 
145
146
  Or, they can be passed to `prettier` as arguments:
146
147
 
147
148
  ```bash
148
- prettier --prefer-single-quotes false --write '**/*.rb'
149
+ prettier --ruby-single-quote false --write '**/*.rb'
149
150
  ```
150
151
 
151
152
  ## Contributing
@@ -161,69 +162,75 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
161
162
  <!-- markdownlint-disable -->
162
163
  <table>
163
164
  <tr>
164
- <td align="center"><a href="https://kevindeisz.com"><img src="https://avatars2.githubusercontent.com/u/5093358?v=4" width="100px;" alt=""/><br /><sub><b>Kevin Deisz</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akddeisz" title="Bug reports">🐛</a></td>
165
- <td align="center"><a href="https://www.alanfoster.me/"><img src="https://avatars2.githubusercontent.com/u/1271782?v=4" width="100px;" alt=""/><br /><sub><b>Alan Foster</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AAlanFoster" title="Bug reports">🐛</a></td>
166
- <td align="center"><a href="https://github.com/johnschoeman"><img src="https://avatars0.githubusercontent.com/u/16049495?v=4" width="100px;" alt=""/><br /><sub><b>johnschoeman</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=johnschoeman" title="Tests">⚠️</a></td>
167
- <td align="center"><a href="https://twitter.com/aaronjensen"><img src="https://avatars3.githubusercontent.com/u/8588?v=4" width="100px;" alt=""/><br /><sub><b>Aaron Jensen</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=aaronjensen" title="Documentation">📖</a></td>
168
- <td align="center"><a href="http://cameronbothner.com"><img src="https://avatars1.githubusercontent.com/u/4642599?v=4" width="100px;" alt=""/><br /><sub><b>Cameron Bothner</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=cbothner" title="Code">💻</a></td>
169
- <td align="center"><a href="https://localhost.dev"><img src="https://avatars3.githubusercontent.com/u/47308085?v=4" width="100px;" alt=""/><br /><sub><b>localhost.dev</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Alocalhostdotdev" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=localhostdotdev" title="Code">💻</a></td>
170
- <td align="center"><a href="https://deecewan.github.io"><img src="https://avatars0.githubusercontent.com/u/4755785?v=4" width="100px;" alt=""/><br /><sub><b>David Buchan-Swanson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Adeecewan" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=deecewan" title="Code">💻</a></td>
165
+ <td align="center"><a href="https://kevindeisz.com"><img src="https://avatars2.githubusercontent.com/u/5093358?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kevin Deisz</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akddeisz" title="Bug reports">🐛</a></td>
166
+ <td align="center"><a href="https://www.alanfoster.me/"><img src="https://avatars2.githubusercontent.com/u/1271782?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alan Foster</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AAlanFoster" title="Bug reports">🐛</a></td>
167
+ <td align="center"><a href="https://github.com/johnschoeman"><img src="https://avatars0.githubusercontent.com/u/16049495?v=4?s=100" width="100px;" alt=""/><br /><sub><b>johnschoeman</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=johnschoeman" title="Tests">⚠️</a></td>
168
+ <td align="center"><a href="https://twitter.com/aaronjensen"><img src="https://avatars3.githubusercontent.com/u/8588?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aaron Jensen</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=aaronjensen" title="Documentation">📖</a></td>
169
+ <td align="center"><a href="http://cameronbothner.com"><img src="https://avatars1.githubusercontent.com/u/4642599?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cameron Bothner</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=cbothner" title="Code">💻</a></td>
170
+ <td align="center"><a href="https://localhost.dev"><img src="https://avatars3.githubusercontent.com/u/47308085?v=4?s=100" width="100px;" alt=""/><br /><sub><b>localhost.dev</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Alocalhostdotdev" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=localhostdotdev" title="Code">💻</a></td>
171
+ <td align="center"><a href="https://deecewan.github.io"><img src="https://avatars0.githubusercontent.com/u/4755785?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Buchan-Swanson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Adeecewan" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=deecewan" title="Code">💻</a></td>
171
172
  </tr>
172
173
  <tr>
173
- <td align="center"><a href="https://github.com/jpickwell"><img src="https://avatars1.githubusercontent.com/u/4682321?v=4" width="100px;" alt=""/><br /><sub><b>Jordan Pickwell</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajpickwell" title="Bug reports">🐛</a></td>
174
- <td align="center"><a href="http://codingitwrong.com"><img src="https://avatars0.githubusercontent.com/u/15832198?v=4" width="100px;" alt=""/><br /><sub><b>Josh Justice</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ACodingItWrong" title="Bug reports">🐛</a></td>
175
- <td align="center"><a href="https://github.com/xipgroc"><img src="https://avatars0.githubusercontent.com/u/28561131?v=4" width="100px;" alt=""/><br /><sub><b>xipgroc</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Axipgroc" title="Bug reports">🐛</a></td>
176
- <td align="center"><a href="http://lejeun.es"><img src="https://avatars1.githubusercontent.com/u/15168?v=4" width="100px;" alt=""/><br /><sub><b>Gregoire Lejeune</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aglejeune" title="Bug reports">🐛</a></td>
177
- <td align="center"><a href="https://github.com/petevk"><img src="https://avatars3.githubusercontent.com/u/5108627?v=4" width="100px;" alt=""/><br /><sub><b>Pete Van Klaveren</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Apetevk" title="Bug reports">🐛</a></td>
178
- <td align="center"><a href="https://github.com/meleyal"><img src="https://avatars3.githubusercontent.com/u/15045?v=4" width="100px;" alt=""/><br /><sub><b>meleyal</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=meleyal" title="Documentation">📖</a></td>
179
- <td align="center"><a href="https://lip.is"><img src="https://avatars1.githubusercontent.com/u/125676?v=4" width="100px;" alt=""/><br /><sub><b>Lipis</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=lipis" title="Documentation">📖</a></td>
174
+ <td align="center"><a href="https://github.com/jpickwell"><img src="https://avatars1.githubusercontent.com/u/4682321?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jordan Pickwell</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajpickwell" title="Bug reports">🐛</a></td>
175
+ <td align="center"><a href="http://codingitwrong.com"><img src="https://avatars0.githubusercontent.com/u/15832198?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Josh Justice</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ACodingItWrong" title="Bug reports">🐛</a></td>
176
+ <td align="center"><a href="https://github.com/xipgroc"><img src="https://avatars0.githubusercontent.com/u/28561131?v=4?s=100" width="100px;" alt=""/><br /><sub><b>xipgroc</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Axipgroc" title="Bug reports">🐛</a></td>
177
+ <td align="center"><a href="http://lejeun.es"><img src="https://avatars1.githubusercontent.com/u/15168?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gregoire Lejeune</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aglejeune" title="Bug reports">🐛</a></td>
178
+ <td align="center"><a href="https://github.com/petevk"><img src="https://avatars3.githubusercontent.com/u/5108627?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pete Van Klaveren</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Apetevk" title="Bug reports">🐛</a></td>
179
+ <td align="center"><a href="https://github.com/meleyal"><img src="https://avatars3.githubusercontent.com/u/15045?v=4?s=100" width="100px;" alt=""/><br /><sub><b>meleyal</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=meleyal" title="Documentation">📖</a></td>
180
+ <td align="center"><a href="https://lip.is"><img src="https://avatars1.githubusercontent.com/u/125676?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lipis</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=lipis" title="Documentation">📖</a></td>
180
181
  </tr>
181
182
  <tr>
182
- <td align="center"><a href="https://janpiotrowski.de"><img src="https://avatars0.githubusercontent.com/u/183673?v=4" width="100px;" alt=""/><br /><sub><b>Jan Piotrowski</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janpio" title="Documentation">📖</a></td>
183
- <td align="center"><a href="https://www.andywaite.com"><img src="https://avatars1.githubusercontent.com/u/13400?v=4" width="100px;" alt=""/><br /><sub><b>Andy Waite</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=andyw8" title="Documentation">📖</a></td>
184
- <td align="center"><a href="https://github.com/jviney"><img src="https://avatars3.githubusercontent.com/u/7051?v=4" width="100px;" alt=""/><br /><sub><b>Jonathan Viney</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajviney" title="Bug reports">🐛</a></td>
185
- <td align="center"><a href="https://github.com/acrewdson"><img src="https://avatars0.githubusercontent.com/u/10353074?v=4" width="100px;" alt=""/><br /><sub><b>acrewdson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aacrewdson" title="Bug reports">🐛</a></td>
186
- <td align="center"><a href="https://orleans.io"><img src="https://avatars0.githubusercontent.com/u/1683595?v=4" width="100px;" alt=""/><br /><sub><b>Louis Orleans</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Adudeofawesome" title="Bug reports">🐛</a></td>
187
- <td align="center"><a href="https://github.com/cvoege"><img src="https://avatars2.githubusercontent.com/u/6777709?v=4" width="100px;" alt=""/><br /><sub><b>Colton Voege</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Acvoege" title="Bug reports">🐛</a></td>
188
- <td align="center"><a href="https://stefankracht.de"><img src="https://avatars1.githubusercontent.com/u/529711?v=4" width="100px;" alt=""/><br /><sub><b>Stefan Kracht</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akrachtstefan" title="Bug reports">🐛</a></td>
183
+ <td align="center"><a href="https://janpiotrowski.de"><img src="https://avatars0.githubusercontent.com/u/183673?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan Piotrowski</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janpio" title="Documentation">📖</a></td>
184
+ <td align="center"><a href="https://www.andywaite.com"><img src="https://avatars1.githubusercontent.com/u/13400?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andy Waite</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=andyw8" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aandyw8" title="Bug reports">🐛</a></td>
185
+ <td align="center"><a href="https://github.com/jviney"><img src="https://avatars3.githubusercontent.com/u/7051?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jonathan Viney</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajviney" title="Bug reports">🐛</a></td>
186
+ <td align="center"><a href="https://github.com/acrewdson"><img src="https://avatars0.githubusercontent.com/u/10353074?v=4?s=100" width="100px;" alt=""/><br /><sub><b>acrewdson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aacrewdson" title="Bug reports">🐛</a></td>
187
+ <td align="center"><a href="https://orleans.io"><img src="https://avatars0.githubusercontent.com/u/1683595?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Louis Orleans</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Adudeofawesome" title="Bug reports">🐛</a></td>
188
+ <td align="center"><a href="https://github.com/cvoege"><img src="https://avatars2.githubusercontent.com/u/6777709?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Colton Voege</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Acvoege" title="Bug reports">🐛</a></td>
189
+ <td align="center"><a href="https://stefankracht.de"><img src="https://avatars1.githubusercontent.com/u/529711?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stefan Kracht</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akrachtstefan" title="Bug reports">🐛</a></td>
189
190
  </tr>
190
191
  <tr>
191
- <td align="center"><a href="https://github.com/jakeprime"><img src="https://avatars1.githubusercontent.com/u/1019036?v=4" width="100px;" alt=""/><br /><sub><b>jakeprime</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajakeprime" title="Bug reports">🐛</a></td>
192
- <td align="center"><a href="http://mmainz.github.io"><img src="https://avatars2.githubusercontent.com/u/5417714?v=4" width="100px;" alt=""/><br /><sub><b>Mario Mainz</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ammainz" title="Bug reports">🐛</a></td>
193
- <td align="center"><a href="http://www.cldevs.com"><img src="https://avatars3.githubusercontent.com/u/38632061?v=4" width="100px;" alt=""/><br /><sub><b>CL Web Developers</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Acldevs" title="Bug reports">🐛</a></td>
194
- <td align="center"><a href="https://twitter.com/github0013"><img src="https://avatars0.githubusercontent.com/u/809378?v=4" width="100px;" alt=""/><br /><sub><b>github0013</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Agithub0013" title="Bug reports">🐛</a></td>
195
- <td align="center"><a href="https://jami.am"><img src="https://avatars1.githubusercontent.com/u/1456118?v=4" width="100px;" alt=""/><br /><sub><b>James Costian</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajamescostian" title="Bug reports">🐛</a></td>
196
- <td align="center"><a href="https://github.com/joeyjoejoejr"><img src="https://avatars0.githubusercontent.com/u/1141502?v=4" width="100px;" alt=""/><br /><sub><b>Joe Jackson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajoeyjoejoejr" title="Bug reports">🐛</a></td>
197
- <td align="center"><a href="http://178.is"><img src="https://avatars3.githubusercontent.com/u/134942?v=4" width="100px;" alt=""/><br /><sub><b>Max Albrecht</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aeins78" title="Bug reports">🐛</a></td>
192
+ <td align="center"><a href="https://github.com/jakeprime"><img src="https://avatars1.githubusercontent.com/u/1019036?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jakeprime</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajakeprime" title="Bug reports">🐛</a></td>
193
+ <td align="center"><a href="http://mmainz.github.io"><img src="https://avatars2.githubusercontent.com/u/5417714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mario Mainz</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ammainz" title="Bug reports">🐛</a></td>
194
+ <td align="center"><a href="http://www.cldevs.com"><img src="https://avatars3.githubusercontent.com/u/38632061?v=4?s=100" width="100px;" alt=""/><br /><sub><b>CL Web Developers</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Acldevs" title="Bug reports">🐛</a></td>
195
+ <td align="center"><a href="https://twitter.com/github0013"><img src="https://avatars0.githubusercontent.com/u/809378?v=4?s=100" width="100px;" alt=""/><br /><sub><b>github0013</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Agithub0013" title="Bug reports">🐛</a></td>
196
+ <td align="center"><a href="https://jami.am"><img src="https://avatars1.githubusercontent.com/u/1456118?v=4?s=100" width="100px;" alt=""/><br /><sub><b>James Costian</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajamescostian" title="Bug reports">🐛</a></td>
197
+ <td align="center"><a href="https://github.com/joeyjoejoejr"><img src="https://avatars0.githubusercontent.com/u/1141502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joe Jackson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajoeyjoejoejr" title="Bug reports">🐛</a></td>
198
+ <td align="center"><a href="http://178.is"><img src="https://avatars3.githubusercontent.com/u/134942?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Max Albrecht</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aeins78" title="Bug reports">🐛</a></td>
198
199
  </tr>
199
200
  <tr>
200
- <td align="center"><a href="https://github.com/matt-wratt"><img src="https://avatars0.githubusercontent.com/u/570030?v=4" width="100px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Amatt-wratt" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=matt-wratt" title="Code">💻</a></td>
201
- <td align="center"><a href="http://vesalaakso.com"><img src="https://avatars2.githubusercontent.com/u/482561?v=4" width="100px;" alt=""/><br /><sub><b>Vesa Laakso</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=valscion" title="Documentation">📖</a></td>
202
- <td align="center"><a href="https://github.com/jrdioko"><img src="https://avatars0.githubusercontent.com/u/405288?v=4" width="100px;" alt=""/><br /><sub><b>jrdioko</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajrdioko" title="Bug reports">🐛</a></td>
203
- <td align="center"><a href="http://gin0606.hatenablog.com"><img src="https://avatars2.githubusercontent.com/u/795891?v=4" width="100px;" alt=""/><br /><sub><b>gin0606</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Agin0606" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=gin0606" title="Code">💻</a></td>
204
- <td align="center"><a href="https://github.com/tobyndockerill"><img src="https://avatars1.githubusercontent.com/u/5688326?v=4" width="100px;" alt=""/><br /><sub><b>Tobyn</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=tobyndockerill" title="Code">💻</a></td>
205
- <td align="center"><a href="http://ianks.com"><img src="https://avatars0.githubusercontent.com/u/3303032?v=4" width="100px;" alt=""/><br /><sub><b>Ian Ker-Seymer</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=ianks" title="Code">💻</a></td>
206
- <td align="center"><a href="https://huangzhimin.com"><img src="https://avatars2.githubusercontent.com/u/66836?v=4" width="100px;" alt=""/><br /><sub><b>Richard Huang</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=flyerhzm" title="Code">💻</a></td>
201
+ <td align="center"><a href="https://github.com/matt-wratt"><img src="https://avatars0.githubusercontent.com/u/570030?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Amatt-wratt" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=matt-wratt" title="Code">💻</a></td>
202
+ <td align="center"><a href="http://vesalaakso.com"><img src="https://avatars2.githubusercontent.com/u/482561?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vesa Laakso</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=valscion" title="Documentation">📖</a></td>
203
+ <td align="center"><a href="https://github.com/jrdioko"><img src="https://avatars0.githubusercontent.com/u/405288?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jrdioko</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajrdioko" title="Bug reports">🐛</a></td>
204
+ <td align="center"><a href="http://gin0606.hatenablog.com"><img src="https://avatars2.githubusercontent.com/u/795891?v=4?s=100" width="100px;" alt=""/><br /><sub><b>gin0606</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Agin0606" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=gin0606" title="Code">💻</a></td>
205
+ <td align="center"><a href="https://github.com/tobyndockerill"><img src="https://avatars1.githubusercontent.com/u/5688326?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tobyn</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=tobyndockerill" title="Code">💻</a></td>
206
+ <td align="center"><a href="http://ianks.com"><img src="https://avatars0.githubusercontent.com/u/3303032?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ian Ker-Seymer</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=ianks" title="Code">💻</a></td>
207
+ <td align="center"><a href="https://huangzhimin.com"><img src="https://avatars2.githubusercontent.com/u/66836?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Richard Huang</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=flyerhzm" title="Code">💻</a></td>
207
208
  </tr>
208
209
  <tr>
209
- <td align="center"><a href="https://github.com/pje"><img src="https://avatars1.githubusercontent.com/u/319655?v=4" width="100px;" alt=""/><br /><sub><b>Patrick Ellis</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Apje" title="Bug reports">🐛</a></td>
210
- <td align="center"><a href="https://www.piesync.com/"><img src="https://avatars0.githubusercontent.com/u/161271?v=4" width="100px;" alt=""/><br /><sub><b>Peter De Berdt</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Amasqita" title="Bug reports">🐛</a></td>
211
- <td align="center"><a href="https://github.com/hafley66"><img src="https://avatars0.githubusercontent.com/u/6750483?v=4" width="100px;" alt=""/><br /><sub><b>Chris Hafley</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ahafley66" title="Bug reports">🐛</a></td>
212
- <td align="center"><a href="http://fruetel.de"><img src="https://avatars1.githubusercontent.com/u/8015212?v=4" width="100px;" alt=""/><br /><sub><b>Thomas Frütel</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AFruetel" title="Bug reports">🐛</a></td>
213
- <td align="center"><a href="https://github.com/alse"><img src="https://avatars1.githubusercontent.com/u/1160249?v=4" width="100px;" alt=""/><br /><sub><b>Alex Serban</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=alse" title="Code">💻</a></td>
214
- <td align="center"><a href="http://sviccari.github.io"><img src="https://avatars3.githubusercontent.com/u/4016985?v=4" width="100px;" alt=""/><br /><sub><b>Stephanie</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=SViccari" title="Code">💻</a></td>
215
- <td align="center"><a href="https://github.com/ShayDavidson"><img src="https://avatars1.githubusercontent.com/u/1366521?v=4" width="100px;" alt=""/><br /><sub><b>Shay Davidson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AShayDavidson" title="Bug reports">🐛</a></td>
210
+ <td align="center"><a href="https://github.com/pje"><img src="https://avatars1.githubusercontent.com/u/319655?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick Ellis</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Apje" title="Bug reports">🐛</a></td>
211
+ <td align="center"><a href="https://www.piesync.com/"><img src="https://avatars0.githubusercontent.com/u/161271?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Peter De Berdt</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Amasqita" title="Bug reports">🐛</a></td>
212
+ <td align="center"><a href="https://github.com/hafley66"><img src="https://avatars0.githubusercontent.com/u/6750483?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Hafley</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ahafley66" title="Bug reports">🐛</a></td>
213
+ <td align="center"><a href="http://fruetel.de"><img src="https://avatars1.githubusercontent.com/u/8015212?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thomas Frütel</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AFruetel" title="Bug reports">🐛</a></td>
214
+ <td align="center"><a href="https://github.com/alse"><img src="https://avatars1.githubusercontent.com/u/1160249?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alex Serban</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=alse" title="Code">💻</a></td>
215
+ <td align="center"><a href="http://sviccari.github.io"><img src="https://avatars3.githubusercontent.com/u/4016985?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stephanie</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=SViccari" title="Code">💻</a></td>
216
+ <td align="center"><a href="https://github.com/ShayDavidson"><img src="https://avatars1.githubusercontent.com/u/1366521?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shay Davidson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AShayDavidson" title="Bug reports">🐛</a></td>
216
217
  </tr>
217
218
  <tr>
218
- <td align="center"><a href="https://github.com/ryan-hunter-pc"><img src="https://avatars2.githubusercontent.com/u/13044512?v=4" width="100px;" alt=""/><br /><sub><b>Ryan Hunter</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=ryan-hunter-pc" title="Code">💻</a></td>
219
- <td align="center"><a href="https://www.locksteplabs.com/"><img src="https://avatars1.githubusercontent.com/u/7811733?v=4" width="100px;" alt=""/><br /><sub><b>Jan Klimo</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janklimo" title="Code">💻</a></td>
220
- <td align="center"><a href="http://ricksullivan.net"><img src="https://avatars0.githubusercontent.com/u/3654176?v=4" width="100px;" alt=""/><br /><sub><b>Rick Sullivan</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ARsullivan00" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=Rsullivan00" title="Code">💻</a></td>
221
- <td align="center"><a href="https://twitter.com/steobrien"><img src="https://avatars3.githubusercontent.com/u/1694410?v=4" width="100px;" alt=""/><br /><sub><b>Stephen O'Brien</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Asteobrien" title="Bug reports">🐛</a></td>
222
- <td align="center"><a href="https://github.com/nimish-mehta"><img src="https://avatars2.githubusercontent.com/u/2488470?v=4" width="100px;" alt=""/><br /><sub><b>Nimish Mehta</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Animish-mehta" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=nimish-mehta" title="Code">💻</a></td>
219
+ <td align="center"><a href="https://github.com/ryan-hunter-pc"><img src="https://avatars2.githubusercontent.com/u/13044512?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan Hunter</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=ryan-hunter-pc" title="Code">💻</a></td>
220
+ <td align="center"><a href="https://www.locksteplabs.com/"><img src="https://avatars1.githubusercontent.com/u/7811733?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan Klimo</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janklimo" title="Code">💻</a></td>
221
+ <td align="center"><a href="http://ricksullivan.net"><img src="https://avatars0.githubusercontent.com/u/3654176?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Rick Sullivan</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ARsullivan00" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=Rsullivan00" title="Code">💻</a></td>
222
+ <td align="center"><a href="https://twitter.com/steobrien"><img src="https://avatars3.githubusercontent.com/u/1694410?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stephen O'Brien</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Asteobrien" title="Bug reports">🐛</a></td>
223
+ <td align="center"><a href="https://github.com/nimish-mehta"><img src="https://avatars2.githubusercontent.com/u/2488470?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nimish Mehta</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Animish-mehta" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=nimish-mehta" title="Code">💻</a></td>
224
+ <td align="center"><a href="https://joshbielick.com/"><img src="https://avatars2.githubusercontent.com/u/1413330?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Josh Bielick</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajbielick" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=jbielick" title="Code">💻</a></td>
225
+ <td align="center"><a href="https://github.com/coiti"><img src="https://avatars3.githubusercontent.com/u/27384706?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Román Coitiño</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Acoiti" title="Bug reports">🐛</a></td>
226
+ </tr>
227
+ <tr>
228
+ <td align="center"><a href="https://github.com/mmcnl"><img src="https://avatars2.githubusercontent.com/u/1498727?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt McNeil</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ammcnl" title="Bug reports">🐛</a></td>
229
+ <td align="center"><a href="https://github.com/johncsnyder"><img src="https://avatars2.githubusercontent.com/u/9882099?v=4?s=100" width="100px;" alt=""/><br /><sub><b>John Snyder</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajohncsnyder" title="Bug reports">🐛</a></td>
223
230
  </tr>
224
231
  </table>
225
232
 
226
- <!-- markdownlint-enable -->
233
+ <!-- markdownlint-restore -->
227
234
  <!-- prettier-ignore-end -->
228
235
 
229
236
  <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -7,8 +7,8 @@ var readline = require('readline');
7
7
  var os = require('os');
8
8
  var tty = require('tty');
9
9
  var util$2 = require('util');
10
- var stream$4 = require('stream');
11
- var events = require('events');
10
+ var stream_1 = require('stream');
11
+ var events_1 = require('events');
12
12
 
13
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
14
 
@@ -18,8 +18,8 @@ var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
18
18
  var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
19
19
  var tty__default = /*#__PURE__*/_interopDefaultLegacy(tty);
20
20
  var util__default = /*#__PURE__*/_interopDefaultLegacy(util$2);
21
- var stream__default = /*#__PURE__*/_interopDefaultLegacy(stream$4);
22
- var events__default = /*#__PURE__*/_interopDefaultLegacy(events);
21
+ var stream_1__default = /*#__PURE__*/_interopDefaultLegacy(stream_1);
22
+ var events_1__default = /*#__PURE__*/_interopDefaultLegacy(events_1);
23
23
 
24
24
  var semverCompare = function cmp(a, b) {
25
25
  var pa = a.split('.');
@@ -58,7 +58,7 @@ var pleaseUpgradeNode = function pleaseUpgradeNode(pkg, opts) {
58
58
  };
59
59
 
60
60
  var name = "prettier";
61
- var version = "2.1.1";
61
+ var version = "2.2.1";
62
62
  var description = "Prettier is an opinionated code formatter";
63
63
  var bin = "./bin/prettier.js";
64
64
  var repository = "prettier/prettier";
@@ -78,33 +78,34 @@ var files = [
78
78
  "bin"
79
79
  ];
80
80
  var dependencies = {
81
- "@angular/compiler": "10.0.12",
81
+ "@angular/compiler": "10.2.3",
82
82
  "@babel/code-frame": "7.10.4",
83
- "@babel/parser": "7.11.2",
84
- "@glimmer/syntax": "0.59.0",
83
+ "@babel/parser": "7.12.5",
84
+ "@glimmer/syntax": "0.66.0",
85
85
  "@iarna/toml": "2.2.5",
86
- "@typescript-eslint/typescript-estree": "3.10.0",
87
- "angular-estree-parser": "2.2.0",
86
+ "@typescript-eslint/typescript-estree": "4.8.1",
87
+ "angular-estree-parser": "2.2.1",
88
88
  "angular-html-parser": "1.7.1",
89
- camelcase: "6.0.0",
89
+ camelcase: "6.2.0",
90
90
  chalk: "4.1.0",
91
91
  "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
92
92
  "cjk-regex": "2.0.0",
93
93
  cosmiconfig: "7.0.0",
94
94
  dashify: "2.0.0",
95
- diff: "4.0.2",
95
+ diff: "5.0.0",
96
96
  editorconfig: "0.15.3",
97
- "editorconfig-to-prettier": "0.1.1",
97
+ "editorconfig-to-prettier": "0.2.0",
98
98
  "escape-string-regexp": "4.0.0",
99
+ espree: "7.3.0",
99
100
  esutils: "2.0.3",
100
101
  "fast-glob": "3.2.4",
101
102
  "fast-json-stable-stringify": "2.1.0",
102
103
  "find-parent-dir": "0.3.0",
103
- "flow-parser": "0.132.0",
104
- "get-stream": "6.0.0",
104
+ "flow-parser": "0.138.0",
105
+ "get-stdin": "8.0.0",
105
106
  globby: "11.0.1",
106
- graphql: "15.3.0",
107
- "html-element-attributes": "2.2.1",
107
+ graphql: "15.4.0",
108
+ "html-element-attributes": "2.3.0",
108
109
  "html-styles": "1.0.0",
109
110
  "html-tag-names": "1.1.5",
110
111
  "html-void-elements": "1.0.5",
@@ -113,12 +114,13 @@ var dependencies = {
113
114
  json5: "2.1.3",
114
115
  leven: "3.1.0",
115
116
  "lines-and-columns": "1.1.6",
116
- "linguist-languages": "7.10.0",
117
+ "linguist-languages": "7.12.1",
117
118
  lodash: "4.17.20",
118
- mem: "6.1.0",
119
+ mem: "8.0.0",
120
+ meriyah: "3.1.6",
119
121
  minimatch: "3.0.4",
120
122
  minimist: "1.2.5",
121
- "n-readlines": "1.0.0",
123
+ "n-readlines": "1.0.1",
122
124
  outdent: "0.7.1",
123
125
  "parse-srcset": "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee",
124
126
  "please-upgrade-node": "3.2.0",
@@ -129,62 +131,64 @@ var dependencies = {
129
131
  "postcss-values-parser": "2.0.1",
130
132
  "regexp-util": "1.2.2",
131
133
  "remark-footnotes": "2.0.0",
132
- "remark-math": "1.0.6",
134
+ "remark-math": "3.0.1",
133
135
  "remark-parse": "8.0.3",
134
- resolve: "1.17.0",
136
+ resolve: "1.19.0",
135
137
  semver: "7.3.2",
136
138
  "string-width": "4.2.0",
137
- typescript: "4.0.2",
139
+ typescript: "4.1.2",
138
140
  "unicode-regex": "3.0.0",
139
141
  unified: "9.2.0",
140
142
  vnopts: "1.0.2",
141
- "yaml-unist-parser": "1.3.0"
143
+ "yaml-unist-parser": "1.3.1"
142
144
  };
143
145
  var devDependencies = {
144
- "@babel/core": "7.11.4",
145
- "@babel/preset-env": "7.11.0",
146
- "@babel/types": "7.11.0",
147
- "@glimmer/reference": "0.59.0",
146
+ "@babel/core": "7.12.3",
147
+ "@babel/preset-env": "7.12.1",
148
+ "@babel/types": "7.12.6",
149
+ "@glimmer/reference": "0.66.0",
148
150
  "@rollup/plugin-alias": "3.1.1",
149
- "@rollup/plugin-babel": "5.2.0",
150
- "@rollup/plugin-commonjs": "14.0.0",
151
+ "@rollup/plugin-babel": "5.2.1",
152
+ "@rollup/plugin-commonjs": "16.0.0",
151
153
  "@rollup/plugin-json": "4.1.0",
152
- "@rollup/plugin-node-resolve": "9.0.0",
153
- "@rollup/plugin-replace": "2.3.3",
154
+ "@rollup/plugin-node-resolve": "10.0.0",
155
+ "@rollup/plugin-replace": "2.3.4",
154
156
  "@types/estree": "0.0.45",
155
- "@types/node": "14.6.0",
156
- "@typescript-eslint/types": "3.10.0",
157
- "babel-loader": "8.1.0",
157
+ "@types/node": "14.14.0",
158
+ "@typescript-eslint/types": "4.8.1",
159
+ "babel-jest": "26.6.3",
160
+ "babel-loader": "8.2.1",
158
161
  benchmark: "2.1.4",
159
162
  "builtin-modules": "3.1.0",
160
163
  "cross-env": "7.0.2",
161
- cspell: "4.1.0",
162
- eslint: "7.7.0",
163
- "eslint-config-prettier": "6.11.0",
164
+ cspell: "4.2.2",
165
+ eslint: "7.13.0",
166
+ "eslint-config-prettier": "6.15.0",
164
167
  "eslint-formatter-friendly": "7.0.0",
165
- "eslint-plugin-import": "2.22.0",
166
- "eslint-plugin-jest": "23.20.0",
168
+ "eslint-plugin-import": "2.22.1",
169
+ "eslint-plugin-jest": "24.1.3",
167
170
  "eslint-plugin-prettier-internal-rules": "file:scripts/tools/eslint-plugin-prettier-internal-rules",
168
- "eslint-plugin-react": "7.20.6",
169
- "eslint-plugin-unicorn": "21.0.0",
170
- execa: "4.0.3",
171
- jest: "26.4.2",
171
+ "eslint-plugin-react": "7.21.5",
172
+ "eslint-plugin-unicorn": "23.0.0",
173
+ execa: "4.1.0",
174
+ jest: "26.6.3",
172
175
  "jest-snapshot-serializer-ansi": "1.0.0",
173
176
  "jest-snapshot-serializer-raw": "1.1.0",
174
- "jest-watch-typeahead": "0.6.0",
177
+ "jest-watch-typeahead": "0.6.1",
175
178
  "npm-run-all": "4.1.5",
176
- prettier: "2.1.0",
179
+ "path-browserify": "1.0.1",
180
+ prettier: "2.2.0",
177
181
  rimraf: "3.0.2",
178
- rollup: "2.26.5",
182
+ rollup: "2.33.3",
179
183
  "rollup-plugin-node-globals": "1.4.0",
180
- "rollup-plugin-terser": "7.0.0",
184
+ "rollup-plugin-terser": "7.0.2",
181
185
  shelljs: "0.8.4",
182
186
  "snapshot-diff": "0.8.1",
183
187
  "strip-ansi": "6.0.0",
184
- "synchronous-promise": "2.0.13",
185
- tempy: "0.6.0",
186
- "terser-webpack-plugin": "4.1.0",
187
- webpack: "4.44.1"
188
+ "synchronous-promise": "2.0.15",
189
+ tempy: "1.0.0",
190
+ "terser-webpack-plugin": "5.0.3",
191
+ webpack: "5.5.1"
188
192
  };
189
193
  var scripts = {
190
194
  prepublishOnly: "echo \"Error: must publish from dist/\" && exit 1",
@@ -202,16 +206,16 @@ var scripts = {
202
206
  "lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
203
207
  "lint:changelog": "node ./scripts/lint-changelog.js",
204
208
  "lint:prettier": "prettier . \"!test*\" --check",
205
- "lint:dist": "eslint --no-eslintrc --no-ignore --env=es6,browser --parser-options=ecmaVersion:2016 \"dist/!(bin-prettier|index|third-party).js\"",
209
+ "lint:dist": "eslint --no-eslintrc --no-ignore --env=es6,browser --parser-options=ecmaVersion:2018 \"dist/!(bin-prettier|index|third-party).js\"",
206
210
  "lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
207
211
  "lint:deps": "node ./scripts/check-deps.js",
208
212
  fix: "run-s fix:eslint fix:prettier",
209
213
  "fix:eslint": "yarn lint:eslint --fix",
210
214
  "fix:prettier": "yarn lint:prettier --write",
211
- build: "node ./scripts/build/build.js",
215
+ build: "node --max-old-space-size=3072 ./scripts/build/build.js",
212
216
  "build-docs": "node ./scripts/build-docs.js"
213
217
  };
214
- var _package = {
218
+ var require$$1 = {
215
219
  name: name,
216
220
  version: version,
217
221
  description: description,
@@ -230,27 +234,6 @@ var _package = {
230
234
  scripts: scripts
231
235
  };
232
236
 
233
- var _package$1 = /*#__PURE__*/Object.freeze({
234
- __proto__: null,
235
- name: name,
236
- version: version,
237
- description: description,
238
- bin: bin,
239
- repository: repository,
240
- homepage: homepage,
241
- author: author,
242
- license: license,
243
- main: main,
244
- browser: browser,
245
- unpkg: unpkg,
246
- engines: engines,
247
- files: files,
248
- dependencies: dependencies,
249
- devDependencies: devDependencies,
250
- scripts: scripts,
251
- 'default': _package
252
- });
253
-
254
237
  var fastJsonStableStringify = function (data, opts) {
255
238
  if (!opts) opts = {};
256
239
  if (typeof opts === 'function') opts = {
@@ -322,7 +305,7 @@ var fastJsonStableStringify = function (data, opts) {
322
305
 
323
306
  var src = require("./index");
324
307
 
325
- const preserveCamelCase = string => {
308
+ const preserveCamelCase = (string, locale) => {
326
309
  let isLastCharLower = false;
327
310
  let isLastCharUpper = false;
328
311
  let isLastLastCharUpper = false;
@@ -342,26 +325,33 @@ const preserveCamelCase = string => {
342
325
  isLastCharUpper = false;
343
326
  isLastCharLower = true;
344
327
  } else {
345
- isLastCharLower = character.toLocaleLowerCase() === character && character.toLocaleUpperCase() !== character;
328
+ isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character;
346
329
  isLastLastCharUpper = isLastCharUpper;
347
- isLastCharUpper = character.toLocaleUpperCase() === character && character.toLocaleLowerCase() !== character;
330
+ isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character;
348
331
  }
349
332
  }
350
333
 
351
334
  return string;
352
335
  };
353
336
 
337
+ const preserveConsecutiveUppercase = input => {
338
+ return input.replace(/^[\p{Lu}](?![\p{Lu}])/gu, m1 => m1.toLowerCase());
339
+ };
340
+
341
+ const postProcess = (input, options) => {
342
+ return input.replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu, (_, p1) => p1.toLocaleUpperCase(options.locale)).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu, m => m.toLocaleUpperCase(options.locale));
343
+ };
344
+
354
345
  const camelCase = (input, options) => {
355
346
  if (!(typeof input === 'string' || Array.isArray(input))) {
356
347
  throw new TypeError('Expected the input to be `string | string[]`');
357
348
  }
358
349
 
359
- options = Object.assign({}, {
360
- pascalCase: false
350
+ options = Object.assign({
351
+ pascalCase: false,
352
+ preserveConsecutiveUppercase: false
361
353
  }, options);
362
354
 
363
- const postProcess = x => options.pascalCase ? x.charAt(0).toLocaleUpperCase() + x.slice(1) : x;
364
-
365
355
  if (Array.isArray(input)) {
366
356
  input = input.map(x => x.trim()).filter(x => x.length).join('-');
367
357
  } else {
@@ -373,17 +363,28 @@ const camelCase = (input, options) => {
373
363
  }
374
364
 
375
365
  if (input.length === 1) {
376
- return options.pascalCase ? input.toLocaleUpperCase() : input.toLocaleLowerCase();
366
+ return options.pascalCase ? input.toLocaleUpperCase(options.locale) : input.toLocaleLowerCase(options.locale);
377
367
  }
378
368
 
379
- const hasUpperCase = input !== input.toLocaleLowerCase();
369
+ const hasUpperCase = input !== input.toLocaleLowerCase(options.locale);
380
370
 
381
371
  if (hasUpperCase) {
382
- input = preserveCamelCase(input);
372
+ input = preserveCamelCase(input, options.locale);
373
+ }
374
+
375
+ input = input.replace(/^[_.\- ]+/, '');
376
+
377
+ if (options.preserveConsecutiveUppercase) {
378
+ input = preserveConsecutiveUppercase(input);
379
+ } else {
380
+ input = input.toLocaleLowerCase();
381
+ }
382
+
383
+ if (options.pascalCase) {
384
+ input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1);
383
385
  }
384
386
 
385
- input = input.replace(/^[_.\- ]+/, '').toLocaleLowerCase().replace(/[_.\- ]+([\p{Alpha}\p{N}_]|$)/gu, (_, p1) => p1.toLocaleUpperCase()).replace(/\d+([\p{Alpha}\p{N}_]|$)/gu, m => m.toLocaleUpperCase());
386
- return postProcess(input);
387
+ return postProcess(input, options);
387
388
  };
388
389
 
389
390
  var camelcase = camelCase; // TODO: Remove this for the next major release
@@ -405,18 +406,14 @@ var dashify = (str, options) => {
405
406
 
406
407
  function createCommonjsModule(fn, basedir, module) {
407
408
  return module = {
408
- path: basedir,
409
- exports: {},
410
- require: function (path, base) {
411
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
412
- }
409
+ path: basedir,
410
+ exports: {},
411
+ require: function (path, base) {
412
+ return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
413
+ }
413
414
  }, fn(module, module.exports), module.exports;
414
415
  }
415
416
 
416
- function getCjsExportFromNamespace (n) {
417
- return n && n['default'] || n;
418
- }
419
-
420
417
  function commonjsRequire () {
421
418
  throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
422
419
  }
@@ -11090,7 +11087,7 @@ var pattern = createCommonjsModule(function (module, exports) {
11090
11087
  */
11091
11088
 
11092
11089
 
11093
- const PassThrough = stream__default['default'].PassThrough;
11090
+ const PassThrough = stream_1__default['default'].PassThrough;
11094
11091
  const slice = Array.prototype.slice;
11095
11092
  var merge2_1 = merge2;
11096
11093
 
@@ -12207,7 +12204,7 @@ var async$2 = createCommonjsModule(function (module, exports) {
12207
12204
  super(_root, _settings);
12208
12205
  this._settings = _settings;
12209
12206
  this._scandir = out$1.scandir;
12210
- this._emitter = new events__default['default'].EventEmitter();
12207
+ this._emitter = new events_1__default['default'].EventEmitter();
12211
12208
  this._queue = queue(this._worker.bind(this), this._settings.concurrency);
12212
12209
  this._isFatalError = false;
12213
12210
  this._isDestroyed = false;
@@ -12371,7 +12368,7 @@ var stream$1 = createCommonjsModule(function (module, exports) {
12371
12368
  this._root = _root;
12372
12369
  this._settings = _settings;
12373
12370
  this._reader = new async$2.default(this._root, this._settings);
12374
- this._stream = new stream__default['default'].Readable({
12371
+ this._stream = new stream_1__default['default'].Readable({
12375
12372
  objectMode: true,
12376
12373
  read: () => {},
12377
12374
  destroy: this._reader.destroy.bind(this._reader)
@@ -12640,7 +12637,7 @@ var stream$2 = createCommonjsModule(function (module, exports) {
12640
12637
 
12641
12638
  static(patterns, options) {
12642
12639
  const filepaths = patterns.map(this._getFullEntryPath, this);
12643
- const stream = new stream__default['default'].PassThrough({
12640
+ const stream = new stream_1__default['default'].PassThrough({
12644
12641
  objectMode: true
12645
12642
  });
12646
12643
 
@@ -13147,7 +13144,7 @@ var stream$3 = createCommonjsModule(function (module, exports) {
13147
13144
  const options = this._getReaderOptions(task);
13148
13145
 
13149
13146
  const source = this.api(root, task, options);
13150
- const destination = new stream__default['default'].Readable({
13147
+ const destination = new stream_1__default['default'].Readable({
13151
13148
  objectMode: true,
13152
13149
  read: () => {}
13153
13150
  });
@@ -14359,7 +14356,8 @@ wordDiff.equals = function (left, right) {
14359
14356
  };
14360
14357
 
14361
14358
  wordDiff.tokenize = function (value) {
14362
- var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
14359
+ // All whitespace symbols except newline group into one token, each newline - in separate token
14360
+ var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
14363
14361
 
14364
14362
  for (var i = 0; i < tokens.length - 1; i++) {
14365
14363
  // If we have an empty string in the next field and we have only word chars before and after, merge
@@ -14444,6 +14442,8 @@ function diffCss(oldStr, newStr, callback) {
14444
14442
  }
14445
14443
 
14446
14444
  function _typeof(obj) {
14445
+ "@babel/helpers - typeof";
14446
+
14447
14447
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
14448
14448
  _typeof = function (obj) {
14449
14449
  return typeof obj;
@@ -14458,23 +14458,36 @@ function _typeof(obj) {
14458
14458
  }
14459
14459
 
14460
14460
  function _toConsumableArray(arr) {
14461
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
14461
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
14462
14462
  }
14463
14463
 
14464
14464
  function _arrayWithoutHoles(arr) {
14465
- if (Array.isArray(arr)) {
14466
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
14467
-
14468
- return arr2;
14469
- }
14465
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
14470
14466
  }
14471
14467
 
14472
14468
  function _iterableToArray(iter) {
14473
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
14469
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
14470
+ }
14471
+
14472
+ function _unsupportedIterableToArray(o, minLen) {
14473
+ if (!o) return;
14474
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
14475
+ var n = Object.prototype.toString.call(o).slice(8, -1);
14476
+ if (n === "Object" && o.constructor) n = o.constructor.name;
14477
+ if (n === "Map" || n === "Set") return Array.from(o);
14478
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14479
+ }
14480
+
14481
+ function _arrayLikeToArray(arr, len) {
14482
+ if (len == null || len > arr.length) len = arr.length;
14483
+
14484
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
14485
+
14486
+ return arr2;
14474
14487
  }
14475
14488
 
14476
14489
  function _nonIterableSpread() {
14477
- throw new TypeError("Invalid attempt to spread non-iterable instance");
14490
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14478
14491
  }
14479
14492
 
14480
14493
  var objectPrototypeToString = Object.prototype.toString;
@@ -14664,12 +14677,23 @@ function parsePatch(uniDiff) {
14664
14677
  chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
14665
14678
  var hunk = {
14666
14679
  oldStart: +chunkHeader[1],
14667
- oldLines: +chunkHeader[2] || 1,
14680
+ oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
14668
14681
  newStart: +chunkHeader[3],
14669
- newLines: +chunkHeader[4] || 1,
14682
+ newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
14670
14683
  lines: [],
14671
14684
  linedelimiters: []
14672
- };
14685
+ }; // Unified Diff Format quirk: If the chunk size is 0,
14686
+ // the first number is one lower than one would expect.
14687
+ // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
14688
+
14689
+ if (hunk.oldLines === 0) {
14690
+ hunk.oldStart += 1;
14691
+ }
14692
+
14693
+ if (hunk.newLines === 0) {
14694
+ hunk.newStart += 1;
14695
+ }
14696
+
14673
14697
  var addCount = 0,
14674
14698
  removeCount = 0;
14675
14699
 
@@ -14862,11 +14886,6 @@ function applyPatch(source, uniDiff) {
14862
14886
 
14863
14887
  diffOffset += _hunk.newLines - _hunk.oldLines;
14864
14888
 
14865
- if (_toPos < 0) {
14866
- // Creating a new file
14867
- _toPos = 0;
14868
- }
14869
-
14870
14889
  for (var j = 0; j < _hunk.lines.length; j++) {
14871
14890
  var line = _hunk.lines[j],
14872
14891
  operation = line.length > 0 ? line[0] : ' ',
@@ -15038,8 +15057,9 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
15038
15057
  var newEOFNewline = /\n$/.test(newStr);
15039
15058
  var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
15040
15059
 
15041
- if (!oldEOFNewline && noNlBeforeAdds) {
15060
+ if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
15042
15061
  // special case: old has no eol and no trailing context; no-nl can end up before adds
15062
+ // however, if the old file is empty, do not output the no-nl line
15043
15063
  curRange.splice(hunk.oldLines, 0, '\');
15044
15064
  }
15045
15065
 
@@ -15073,12 +15093,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
15073
15093
  };
15074
15094
  }
15075
15095
 
15076
- function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
15077
- var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
15096
+ function formatPatch(diff) {
15078
15097
  var ret = [];
15079
15098
 
15080
- if (oldFileName == newFileName) {
15081
- ret.push('Index: ' + oldFileName);
15099
+ if (diff.oldFileName == diff.newFileName) {
15100
+ ret.push('Index: ' + diff.oldFileName);
15082
15101
  }
15083
15102
 
15084
15103
  ret.push('===================================================================');
@@ -15086,7 +15105,18 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
15086
15105
  ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
15087
15106
 
15088
15107
  for (var i = 0; i < diff.hunks.length; i++) {
15089
- var hunk = diff.hunks[i];
15108
+ var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0,
15109
+ // the first number is one lower than one would expect.
15110
+ // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
15111
+
15112
+ if (hunk.oldLines === 0) {
15113
+ hunk.oldStart -= 1;
15114
+ }
15115
+
15116
+ if (hunk.newLines === 0) {
15117
+ hunk.newStart -= 1;
15118
+ }
15119
+
15090
15120
  ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
15091
15121
  ret.push.apply(ret, hunk.lines);
15092
15122
  }
@@ -15094,6 +15124,10 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
15094
15124
  return ret.join('\n') + '\n';
15095
15125
  }
15096
15126
 
15127
+ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
15128
+ return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
15129
+ }
15130
+
15097
15131
  function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
15098
15132
  return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
15099
15133
  }
@@ -15578,34 +15612,32 @@ function escapeHTML(s) {
15578
15612
  var index_es6 = /*#__PURE__*/Object.freeze({
15579
15613
  __proto__: null,
15580
15614
  Diff: Diff,
15581
- diffChars: diffChars,
15582
- diffWords: diffWords,
15583
- diffWordsWithSpace: diffWordsWithSpace,
15584
- diffLines: diffLines,
15585
- diffTrimmedLines: diffTrimmedLines,
15586
- diffSentences: diffSentences,
15587
- diffCss: diffCss,
15588
- diffJson: diffJson,
15589
- diffArrays: diffArrays,
15590
- structuredPatch: structuredPatch,
15591
- createTwoFilesPatch: createTwoFilesPatch,
15592
- createPatch: createPatch,
15593
15615
  applyPatch: applyPatch,
15594
15616
  applyPatches: applyPatches,
15595
- parsePatch: parsePatch,
15596
- merge: merge,
15617
+ canonicalize: canonicalize,
15597
15618
  convertChangesToDMP: convertChangesToDMP,
15598
15619
  convertChangesToXML: convertChangesToXML,
15599
- canonicalize: canonicalize
15620
+ createPatch: createPatch,
15621
+ createTwoFilesPatch: createTwoFilesPatch,
15622
+ diffArrays: diffArrays,
15623
+ diffChars: diffChars,
15624
+ diffCss: diffCss,
15625
+ diffJson: diffJson,
15626
+ diffLines: diffLines,
15627
+ diffSentences: diffSentences,
15628
+ diffTrimmedLines: diffTrimmedLines,
15629
+ diffWords: diffWords,
15630
+ diffWordsWithSpace: diffWordsWithSpace,
15631
+ merge: merge,
15632
+ parsePatch: parsePatch,
15633
+ structuredPatch: structuredPatch
15600
15634
  });
15601
15635
 
15602
- var require$$3 = getCjsExportFromNamespace(index_es6);
15603
-
15604
15636
  // eslint-disable-next-line no-restricted-modules
15605
15637
 
15606
15638
 
15607
15639
  const {
15608
- getStream
15640
+ getStdin
15609
15641
  } = thirdParty;
15610
15642
  const {
15611
15643
  createIgnorer,
@@ -15644,7 +15676,7 @@ function cliifyOptions(object, apiDetailedOptionMap) {
15644
15676
  }
15645
15677
 
15646
15678
  function diff(a, b) {
15647
- return require$$3.createTwoFilesPatch("", "", a, b, "", "", {
15679
+ return index_es6.createTwoFilesPatch("", "", a, b, "", "", {
15648
15680
  context: 2
15649
15681
  });
15650
15682
  }
@@ -15932,7 +15964,7 @@ function formatStdin(context) {
15932
15964
  // ignore path, not the current working directory.
15933
15965
 
15934
15966
  const relativeFilepath = context.argv["ignore-path"] ? path__default['default'].relative(path__default['default'].dirname(context.argv["ignore-path"]), filepath) : path__default['default'].relative(process.cwd(), filepath);
15935
- getStream(process.stdin).then(input => {
15967
+ getStdin().then(input => {
15936
15968
  if (relativeFilepath && ignorer.ignores(fixWindowsSlashes$1(relativeFilepath))) {
15937
15969
  writeOutput(context, {
15938
15970
  formatted: input
@@ -16421,7 +16453,7 @@ function updateContextArgv(context, plugins, pluginSearchDirs) {
16421
16453
  const minimistOptions = createMinimistOptions(context.detailedOptions);
16422
16454
  const argv = minimist_1(context.args, minimistOptions);
16423
16455
  context.argv = argv;
16424
- context.filePatterns = argv._;
16456
+ context.filePatterns = argv._.map(file => String(file));
16425
16457
  }
16426
16458
 
16427
16459
  function normalizeContextArgv(context, keys) {
@@ -16447,8 +16479,6 @@ var util$1 = {
16447
16479
  normalizeDetailedOptionMap
16448
16480
  };
16449
16481
 
16450
- var require$$1 = getCjsExportFromNamespace(_package$1);
16451
-
16452
16482
  pleaseUpgradeNode(require$$1); // eslint-disable-next-line no-restricted-modules
16453
16483
 
16454
16484
  function run(args) {
@@ -16521,3 +16551,6 @@ var cli = {
16521
16551
  };
16522
16552
 
16523
16553
  cli.run(process.argv.slice(2));
16554
+ var prettier = {};
16555
+
16556
+ module.exports = prettier;