prettier 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -1
- data/CONTRIBUTING.md +2 -2
- data/README.md +21 -91
- data/lib/prettier.rb +2 -2
- data/node_modules/prettier/index.js +54 -54
- data/package.json +3 -4
- data/rubocop.yml +26 -0
- data/src/haml/embed.js +87 -0
- data/src/haml/nodes/comment.js +27 -0
- data/src/haml/nodes/doctype.js +34 -0
- data/src/haml/nodes/filter.js +16 -0
- data/src/haml/nodes/hamlComment.js +21 -0
- data/src/haml/nodes/plain.js +6 -0
- data/src/haml/nodes/root.js +8 -0
- data/src/haml/nodes/script.js +33 -0
- data/src/haml/nodes/silentScript.js +59 -0
- data/src/haml/nodes/tag.js +193 -0
- data/src/haml/parser.js +33 -0
- data/src/haml/parser.rb +141 -0
- data/src/haml/printer.js +28 -0
- data/src/{ruby.js → plugin.js} +25 -4
- data/src/prettier.js +1 -0
- data/src/rbs/parser.js +51 -0
- data/src/rbs/parser.rb +91 -0
- data/src/rbs/printer.js +605 -0
- data/src/{embed.js → ruby/embed.js} +6 -2
- data/src/{nodes.js → ruby/nodes.js} +0 -0
- data/src/{nodes → ruby/nodes}/alias.js +1 -1
- data/src/{nodes → ruby/nodes}/aref.js +8 -1
- data/src/{nodes → ruby/nodes}/args.js +2 -2
- data/src/{nodes → ruby/nodes}/arrays.js +2 -3
- data/src/{nodes → ruby/nodes}/assign.js +7 -3
- data/src/ruby/nodes/blocks.js +90 -0
- data/src/{nodes → ruby/nodes}/calls.js +18 -11
- data/src/{nodes → ruby/nodes}/case.js +1 -1
- data/src/{nodes → ruby/nodes}/class.js +1 -1
- data/src/ruby/nodes/commands.js +131 -0
- data/src/{nodes → ruby/nodes}/conditionals.js +3 -3
- data/src/{nodes → ruby/nodes}/constants.js +2 -2
- data/src/{nodes → ruby/nodes}/flow.js +2 -2
- data/src/{nodes → ruby/nodes}/hashes.js +32 -10
- data/src/{nodes → ruby/nodes}/heredocs.js +2 -2
- data/src/ruby/nodes/hooks.js +34 -0
- data/src/{nodes → ruby/nodes}/ints.js +0 -0
- data/src/{nodes → ruby/nodes}/lambdas.js +2 -2
- data/src/{nodes → ruby/nodes}/loops.js +10 -7
- data/src/{nodes → ruby/nodes}/massign.js +8 -1
- data/src/{nodes → ruby/nodes}/methods.js +10 -9
- data/src/{nodes → ruby/nodes}/operators.js +2 -2
- data/src/{nodes → ruby/nodes}/params.js +31 -16
- data/src/{nodes → ruby/nodes}/patterns.js +17 -6
- data/src/{nodes → ruby/nodes}/regexp.js +2 -2
- data/src/{nodes → ruby/nodes}/rescue.js +2 -2
- data/src/ruby/nodes/return.js +94 -0
- data/src/{nodes → ruby/nodes}/statements.js +6 -9
- data/src/{nodes → ruby/nodes}/strings.js +27 -36
- data/src/{nodes → ruby/nodes}/super.js +2 -2
- data/src/{nodes → ruby/nodes}/undef.js +1 -1
- data/src/{parser.js → ruby/parser.js} +4 -3
- data/src/{parser.rb → ruby/parser.rb} +450 -501
- data/src/{printer.js → ruby/printer.js} +33 -1
- data/src/{toProc.js → ruby/toProc.js} +4 -8
- data/src/utils.js +10 -93
- data/src/utils/containsAssignment.js +11 -0
- data/src/utils/getTrailingComma.js +5 -0
- data/src/utils/hasAncestor.js +17 -0
- data/src/utils/literal.js +7 -0
- data/src/utils/makeCall.js +14 -0
- data/src/utils/noIndent.js +11 -0
- data/src/utils/skipAssignIndent.js +10 -0
- metadata +65 -41
- data/src/nodes/blocks.js +0 -85
- data/src/nodes/commands.js +0 -91
- data/src/nodes/hooks.js +0 -44
- data/src/nodes/return.js +0 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 657db7d1eef6e33d72337eb6b666678675c9eced4cc19716466b4bd74c039cfc
|
4
|
+
data.tar.gz: d69ffa4e3b2b48146c112a9ceb0d4ddab3351119c1bb2b9d92848f7beb3f40e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7c4d27daddee1e5d07393c5358e48a419c75a6e1aff62b36779d093f16f3da613c938b98c188752c93835e66ddd9578ebf6595fcde1a1f69f40f2613b492ddd
|
7
|
+
data.tar.gz: c586e33dcd0057779689df71ab68d8858aac27c9e89cf2f500edd2b55779b26693cf6756815cc616054c364b6bc4e1adff05263036f74025425218c04676969c
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,53 @@ 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.3.0] - 2021-01-05
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- [@kddeisz] - Handling of the RBS language.
|
14
|
+
- [@kddeisz] - Incorporate the HAML plugin.
|
15
|
+
|
16
|
+
## [1.2.5] - 2021-01-04
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
|
20
|
+
- [@nruth], [@kddeisz] - Ensure unary operators on method calls that are sending operators get the correct scanner events.
|
21
|
+
- [@cvoege], [@kddeisz] - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments.
|
22
|
+
- [@valscion], [@kddeisz] - Print method chains more nicely off array and hash literals.
|
23
|
+
|
24
|
+
## [1.2.4] - 2021-01-03
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- [@andyw8] - Explain usage with Rubocop, as well as shipping a rubocop.yml config.
|
29
|
+
|
30
|
+
### Changed
|
31
|
+
|
32
|
+
- [@kddeisz] - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`.
|
33
|
+
- [@kddeisz] - Up the max buffer size between the Ruby and node processes to 15K.
|
34
|
+
|
35
|
+
## [1.2.3] - 2021-01-02
|
36
|
+
|
37
|
+
### Changed
|
38
|
+
|
39
|
+
- [@lukyth], [@kddeisz] - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added.
|
40
|
+
- [@AlanFoster], [@kddeisz] - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser.
|
41
|
+
- [@AlanFoster], [@kddeisz] - Ensure key-value pairs split on line when the key has a comment attached within a hash.
|
42
|
+
- [@AlanFoster], [@kddeisz] - Fix for `for` loops that have multiple index variables.
|
43
|
+
- [@AlanFoster], [@kddeisz] - Fix parsing very large files by reducing the size of the JSON output from the parser.
|
44
|
+
- [@AlanFoster], [@kddeisz] - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator.
|
45
|
+
|
46
|
+
## [1.2.2] - 2021-01-01
|
47
|
+
|
48
|
+
### Changed
|
49
|
+
|
50
|
+
- [@nathan-beam] - Gem does not work with CMD/Powershell.
|
51
|
+
- [@blampe], [@kddeisz] - Comments inside keyword parameters in method declarations are not printed.
|
52
|
+
- [@blampe], [@kddeisz] - `command_call` nodes with unary operators incorrectly parse their operator.
|
53
|
+
- [@blampe], [@kddeisz] - Returning multiple values where the first has parentheses was incorrectly removing the remaining values.
|
54
|
+
- [@johncsnyder], [@kddeisz] - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain.
|
55
|
+
|
9
56
|
## [1.2.1] - 2020-12-27
|
10
57
|
|
11
58
|
### Changed
|
@@ -988,7 +1035,14 @@ would previously result in `array[]`, but now prints properly.
|
|
988
1035
|
|
989
1036
|
- Initial release 🎉
|
990
1037
|
|
991
|
-
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.
|
1038
|
+
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v1.3.0...HEAD
|
1039
|
+
[1.3.0]: https://github.com/prettier/plugin-ruby/compare/v1.2.5...v1.3.0
|
1040
|
+
[1.2.5]: https://github.com/prettier/plugin-ruby/compare/v1.2.4...v1.2.5
|
1041
|
+
[1.2.4]: https://github.com/prettier/plugin-ruby/compare/v1.2.3...v1.2.4
|
1042
|
+
[1.2.3]: https://github.com/prettier/plugin-ruby/compare/v1.2.2...v1.2.3
|
1043
|
+
[1.2.2]: https://github.com/prettier/plugin-ruby/compare/v1.2.1...v1.2.2
|
1044
|
+
[1.2.1]: https://github.com/prettier/plugin-ruby/compare/v1.2.0...v1.2.1
|
1045
|
+
[1.2.0]: https://github.com/prettier/plugin-ruby/compare/v1.1.0...v1.2.0
|
992
1046
|
[1.1.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.1...v1.1.0
|
993
1047
|
[1.0.1]: https://github.com/prettier/plugin-ruby/compare/v1.0.0...v1.0.1
|
994
1048
|
[1.0.0]: https://github.com/prettier/plugin-ruby/compare/v1.0.0-rc2...v1.0.0
|
@@ -1049,12 +1103,14 @@ would previously result in `array[]`, but now prints properly.
|
|
1049
1103
|
[@andyw8]: https://github.com/andyw8
|
1050
1104
|
[@ashfurrow]: https://github.com/ashfurrow
|
1051
1105
|
[@awinograd]: https://github.com/awinograd
|
1106
|
+
[@blampe]: https://github.com/blampe
|
1052
1107
|
[@bugthing]: https://github.com/bugthing
|
1053
1108
|
[@cbothner]: https://github.com/cbothner
|
1054
1109
|
[@christoomey]: https://github.com/christoomey
|
1055
1110
|
[@cldevs]: https://github.com/cldevs
|
1056
1111
|
[@codingitwrong]: https://github.com/CodingItWrong
|
1057
1112
|
[@coiti]: https://github.com/coiti
|
1113
|
+
[@cvoege]: https://github.com/cvoege
|
1058
1114
|
[@deecewan]: https://github.com/deecewan
|
1059
1115
|
[@dudeofawesome]: https://github.com/dudeofawesome
|
1060
1116
|
[@eins78]: https://github.com/eins78
|
@@ -1082,13 +1138,16 @@ would previously result in `array[]`, but now prints properly.
|
|
1082
1138
|
[@kmcq]: https://github.com/kmcq
|
1083
1139
|
[@krachtstefan]: https://github.com/krachtstefan
|
1084
1140
|
[@localhostdotdev]: https://github.com/localhostdotdev
|
1141
|
+
[@lukyth]: https://github.com/lukyth
|
1085
1142
|
[@marcmaniez]: https://github.com/MarcManiez
|
1086
1143
|
[@masqita]: https://github.com/masqita
|
1087
1144
|
[@matt-wratt]: https://github.com/matt-wratt
|
1088
1145
|
[@meleyal]: https://github.com/meleyal
|
1089
1146
|
[@mmainz]: https://github.com/mmainz
|
1090
1147
|
[@mmcnl]: https://github.com/mmcnl
|
1148
|
+
[@nathan-beam]: https://github.com/nathan-beam
|
1091
1149
|
[@noahtheduke]: https://github.com/NoahTheDuke
|
1150
|
+
[@nruth]: https://github.com/nruth
|
1092
1151
|
[@overload119]: https://github.com/Overload119
|
1093
1152
|
[@petevk]: https://github.com/petevk
|
1094
1153
|
[@pje]: https://github.com/pje
|
@@ -1102,6 +1161,7 @@ would previously result in `array[]`, but now prints properly.
|
|
1102
1161
|
[@sviccari]: https://github.com/SViccari
|
1103
1162
|
[@tobyndockerill]: https://github.com/tobyndockerill
|
1104
1163
|
[@uri]: https://github.com/uri
|
1164
|
+
[@valscion]: https://github.com/valscion
|
1105
1165
|
[@xipgroc]: https://github.com/xipgroc
|
1106
1166
|
[@ykpythemind]: https://github.com/ykpythemind
|
1107
1167
|
[@yuki24]: https://github.com/yuki24
|
data/CONTRIBUTING.md
CHANGED
@@ -22,7 +22,7 @@ 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/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.
|
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/ruby/parser.js). For the case of the Ruby plugin, that entails spawning a Ruby process that runs [parser.rb](src/ruby/parser.rb) with the input code preloaded on stdin.
|
26
26
|
|
27
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
|
|
@@ -71,7 +71,7 @@ Now that the text has been transformed into an AST that we can work with, `parse
|
|
71
71
|
|
72
72
|
### AST to Doc
|
73
73
|
|
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.
|
74
|
+
Once prettier has a working AST, it will take it and call the selected plugin's [`printNode` function](src/ruby/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.
|
75
75
|
|
76
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.
|
77
77
|
|
data/README.md
CHANGED
@@ -72,6 +72,12 @@ To run `prettier` with the Ruby plugin, you're going to need [`ruby`](https://ww
|
|
72
72
|
|
73
73
|
Note that currently the editor integrations work best with the `npm` package, as most of the major editor plugins expect a `node_modules` directory. You can get them to work with the Ruby gem, but it requires manually configuring the paths.
|
74
74
|
|
75
|
+
This plugin currently supports formatting the following kinds of files:
|
76
|
+
|
77
|
+
- All varieties of Ruby source files (e.g., `*.rb`, `*.gemspec`, `Gemfile`, etc.)
|
78
|
+
- [RBS type language](https://github.com/ruby/rbs) files - requires having the `rbs` gem in your gem path
|
79
|
+
- [HAML template language](https://haml.info/) files - requires having the `haml` gem in your gem path
|
80
|
+
|
75
81
|
### Ruby gem
|
76
82
|
|
77
83
|
Add this line to your application's Gemfile:
|
@@ -95,7 +101,7 @@ gem install prettier
|
|
95
101
|
The `rbprettier` executable is now installed and ready for use:
|
96
102
|
|
97
103
|
```bash
|
98
|
-
bundle exec rbprettier --write '
|
104
|
+
bundle exec rbprettier --write '**/*'
|
99
105
|
```
|
100
106
|
|
101
107
|
### `npm` package
|
@@ -115,12 +121,12 @@ yarn add --dev prettier @prettier/plugin-ruby
|
|
115
121
|
The `prettier` executable is now installed and ready for use:
|
116
122
|
|
117
123
|
```bash
|
118
|
-
./node_modules/.bin/prettier --write '
|
124
|
+
./node_modules/.bin/prettier --write '**/*'
|
119
125
|
```
|
120
126
|
|
121
127
|
## Configuration
|
122
128
|
|
123
|
-
Below are the options (from [`src/
|
129
|
+
Below are the options (from [`src/plugin.js`](src/plugin.js)) that `@prettier/plugin-ruby` currently supports:
|
124
130
|
|
125
131
|
| API Option | CLI Option | Default | Description |
|
126
132
|
| ------------------ | ---------------------- | :-----: | ------------------------------------------------------------------------------------------------------------------------------------ |
|
@@ -146,101 +152,25 @@ file](https://prettier.io/docs/en/configuration.html). For example:
|
|
146
152
|
Or, they can be passed to `prettier` as arguments:
|
147
153
|
|
148
154
|
```bash
|
149
|
-
prettier --ruby-single-quote false --write '
|
155
|
+
prettier --ruby-single-quote false --write '**/*'
|
150
156
|
```
|
151
157
|
|
152
|
-
|
153
|
-
|
154
|
-
Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby.
|
155
|
-
|
156
|
-
### Code
|
158
|
+
### Usage with RuboCop
|
157
159
|
|
158
|
-
|
160
|
+
RuboCop and Prettier for Ruby serve different purposes, but there is overlap
|
161
|
+
with some of RuboCop's functionality.
|
159
162
|
|
160
|
-
|
161
|
-
|
162
|
-
<!-- markdownlint-disable -->
|
163
|
-
<table>
|
164
|
-
<tr>
|
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>
|
172
|
-
</tr>
|
173
|
-
<tr>
|
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>
|
181
|
-
</tr>
|
182
|
-
<tr>
|
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>
|
190
|
-
</tr>
|
191
|
-
<tr>
|
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>
|
199
|
-
</tr>
|
200
|
-
<tr>
|
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>
|
208
|
-
</tr>
|
209
|
-
<tr>
|
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>
|
217
|
-
</tr>
|
218
|
-
<tr>
|
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>
|
230
|
-
<td align="center"><a href="https://github.com/rindek"><img src="https://avatars1.githubusercontent.com/u/881209?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jacek Jakubik</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Arindek" title="Bug reports">🐛</a></td>
|
231
|
-
<td align="center"><a href="https://twitter.com/ykpythemind"><img src="https://avatars2.githubusercontent.com/u/22209702?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yukito Ito</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aykpythemind" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=ykpythemind" title="Code">💻</a></td>
|
232
|
-
<td align="center"><a href="https://studyfied.com/"><img src="https://avatars2.githubusercontent.com/u/45869605?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Karan Mandal</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akaranmandal" title="Bug reports">🐛</a></td>
|
233
|
-
</tr>
|
234
|
-
</table>
|
235
|
-
|
236
|
-
<!-- markdownlint-restore -->
|
237
|
-
<!-- prettier-ignore-end -->
|
163
|
+
Prettier provides a RuboCop configuration file to disable the rules which clash.
|
164
|
+
To enable, add the following config at the top of your project's `.rubocop.yml`:
|
238
165
|
|
239
|
-
|
166
|
+
```yaml
|
167
|
+
inherit_gem:
|
168
|
+
prettier: rubocop.yml
|
169
|
+
```
|
240
170
|
|
241
|
-
|
171
|
+
## Contributing
|
242
172
|
|
243
|
-
|
173
|
+
Check out our [contributing guide](CONTRIBUTING.md). Bug reports and pull requests are welcome on GitHub at https://github.com/prettier/plugin-ruby.
|
244
174
|
|
245
175
|
You can support `prettier/plugin-ruby` [on OpenCollective](https://opencollective.com/prettier-ruby/contribute). Your organization's logo will show up here with a link to your website.
|
246
176
|
|
data/lib/prettier.rb
CHANGED
@@ -9,8 +9,8 @@ module Prettier
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
def run(args)
|
12
|
-
quoted = args.map { |arg| arg.start_with?('-') ? arg : "
|
13
|
-
command = "node #{BINARY} --plugin
|
12
|
+
quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" }
|
13
|
+
command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}"
|
14
14
|
|
15
15
|
system({ 'RBPRETTIER' => '1' }, command)
|
16
16
|
end
|
@@ -5249,19 +5249,19 @@ var errors = {
|
|
5249
5249
|
UndefinedParserError
|
5250
5250
|
};
|
5251
5251
|
|
5252
|
-
/*! *****************************************************************************
|
5253
|
-
Copyright (c) Microsoft Corporation.
|
5254
|
-
|
5255
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
5256
|
-
purpose with or without fee is hereby granted.
|
5257
|
-
|
5258
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
5259
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
5260
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
5261
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
5262
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
5263
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
5264
|
-
PERFORMANCE OF THIS SOFTWARE.
|
5252
|
+
/*! *****************************************************************************
|
5253
|
+
Copyright (c) Microsoft Corporation.
|
5254
|
+
|
5255
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
5256
|
+
purpose with or without fee is hereby granted.
|
5257
|
+
|
5258
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
5259
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
5260
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
5261
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
5262
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
5263
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
5264
|
+
PERFORMANCE OF THIS SOFTWARE.
|
5265
5265
|
***************************************************************************** */
|
5266
5266
|
|
5267
5267
|
/* global Reflect, Promise */
|
@@ -14638,6 +14638,7 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
|
|
14638
14638
|
} // We let JSXElement print its comments itself because it adds () around
|
14639
14639
|
// UnionTypeAnnotation has to align the child without the comments
|
14640
14640
|
|
14641
|
+
|
14641
14642
|
let res;
|
14642
14643
|
|
14643
14644
|
if (printer.willPrintOwnComments && printer.willPrintOwnComments(path, options)) {
|
@@ -14674,7 +14675,6 @@ function printPrettierIgnoredNode(node, options) {
|
|
14674
14675
|
locStart,
|
14675
14676
|
locEnd
|
14676
14677
|
} = options;
|
14677
|
-
|
14678
14678
|
const start = locStart(node);
|
14679
14679
|
const end = locEnd(node);
|
14680
14680
|
|
@@ -24808,11 +24808,11 @@ var ini = createCommonjsModule(function (module, exports) {
|
|
24808
24808
|
});
|
24809
24809
|
|
24810
24810
|
var fs = __importStar(fs__default['default']);
|
24811
|
-
/**
|
24812
|
-
* define the possible values:
|
24813
|
-
* section: [section]
|
24814
|
-
* param: key=value
|
24815
|
-
* comment: ;this is a comment
|
24811
|
+
/**
|
24812
|
+
* define the possible values:
|
24813
|
+
* section: [section]
|
24814
|
+
* param: key=value
|
24815
|
+
* comment: ;this is a comment
|
24816
24816
|
*/
|
24817
24817
|
|
24818
24818
|
|
@@ -24821,9 +24821,9 @@ var ini = createCommonjsModule(function (module, exports) {
|
|
24821
24821
|
param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
|
24822
24822
|
comment: /^\s*[#;].*$/
|
24823
24823
|
};
|
24824
|
-
/**
|
24825
|
-
* Parses an .ini file
|
24826
|
-
* @param file The location of the .ini file
|
24824
|
+
/**
|
24825
|
+
* Parses an .ini file
|
24826
|
+
* @param file The location of the .ini file
|
24827
24827
|
*/
|
24828
24828
|
|
24829
24829
|
function parse(file) {
|
@@ -29644,8 +29644,8 @@ var path_1 = createCommonjsModule(function (module, exports) {
|
|
29644
29644
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
29645
29645
|
|
29646
29646
|
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
29647
|
-
/**
|
29648
|
-
* Designed to work only with simple paths: `dir\\file`.
|
29647
|
+
/**
|
29648
|
+
* Designed to work only with simple paths: `dir\\file`.
|
29649
29649
|
*/
|
29650
29650
|
|
29651
29651
|
function unixify(filepath) {
|
@@ -34268,17 +34268,17 @@ var pattern = createCommonjsModule(function (module, exports) {
|
|
34268
34268
|
exports.isStaticPattern = isStaticPattern;
|
34269
34269
|
|
34270
34270
|
function isDynamicPattern(pattern, options = {}) {
|
34271
|
-
/**
|
34272
|
-
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
34273
|
-
* An empty string cannot be a dynamic pattern.
|
34274
|
-
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
34271
|
+
/**
|
34272
|
+
* A special case with an empty string is necessary for matching patterns that start with a forward slash.
|
34273
|
+
* An empty string cannot be a dynamic pattern.
|
34274
|
+
* For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
|
34275
34275
|
*/
|
34276
34276
|
if (pattern === '') {
|
34277
34277
|
return false;
|
34278
34278
|
}
|
34279
|
-
/**
|
34280
|
-
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
34281
|
-
* filepath directly (without read directory).
|
34279
|
+
/**
|
34280
|
+
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
|
34281
|
+
* filepath directly (without read directory).
|
34282
34282
|
*/
|
34283
34283
|
|
34284
34284
|
|
@@ -34389,17 +34389,17 @@ var pattern = createCommonjsModule(function (module, exports) {
|
|
34389
34389
|
} = picomatch$1.scan(pattern, Object.assign(Object.assign({}, options), {
|
34390
34390
|
parts: true
|
34391
34391
|
}));
|
34392
|
-
/**
|
34393
|
-
* The scan method returns an empty array in some cases.
|
34394
|
-
* See micromatch/picomatch#58 for more details.
|
34392
|
+
/**
|
34393
|
+
* The scan method returns an empty array in some cases.
|
34394
|
+
* See micromatch/picomatch#58 for more details.
|
34395
34395
|
*/
|
34396
34396
|
|
34397
34397
|
if (parts.length === 0) {
|
34398
34398
|
parts = [pattern];
|
34399
34399
|
}
|
34400
|
-
/**
|
34401
|
-
* The scan method does not return an empty part for the pattern with a forward slash.
|
34402
|
-
* This is another part of micromatch/picomatch#58.
|
34400
|
+
/**
|
34401
|
+
* The scan method does not return an empty part for the pattern with a forward slash.
|
34402
|
+
* This is another part of micromatch/picomatch#58.
|
34403
34403
|
*/
|
34404
34404
|
|
34405
34405
|
|
@@ -34804,8 +34804,8 @@ var constants$5 = createCommonjsModule(function (module, exports) {
|
|
34804
34804
|
const SUPPORTED_MINOR_VERSION = 10;
|
34805
34805
|
const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
|
34806
34806
|
const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
|
34807
|
-
/**
|
34808
|
-
* IS `true` for Node.js 10.10 and greater.
|
34807
|
+
/**
|
34808
|
+
* IS `true` for Node.js 10.10 and greater.
|
34809
34809
|
*/
|
34810
34810
|
|
34811
34811
|
exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
|
@@ -35894,9 +35894,9 @@ var matcher = createCommonjsModule(function (module, exports) {
|
|
35894
35894
|
}
|
35895
35895
|
|
35896
35896
|
_fillStorage() {
|
35897
|
-
/**
|
35898
|
-
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
35899
|
-
* So, before expand patterns with brace expansion into separated patterns.
|
35897
|
+
/**
|
35898
|
+
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
35899
|
+
* So, before expand patterns with brace expansion into separated patterns.
|
35900
35900
|
*/
|
35901
35901
|
const patterns = utils$3.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
35902
35902
|
|
@@ -35958,12 +35958,12 @@ var partial = createCommonjsModule(function (module, exports) {
|
|
35958
35958
|
|
35959
35959
|
for (const pattern of patterns) {
|
35960
35960
|
const section = pattern.sections[0];
|
35961
|
-
/**
|
35962
|
-
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
35963
|
-
* but only if the level has reached the end of the first group.
|
35964
|
-
*
|
35965
|
-
* fixtures/{a,b}/**
|
35966
|
-
* ^ true/false ^ always true
|
35961
|
+
/**
|
35962
|
+
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
35963
|
+
* but only if the level has reached the end of the first group.
|
35964
|
+
*
|
35965
|
+
* fixtures/{a,b}/**
|
35966
|
+
* ^ true/false ^ always true
|
35967
35967
|
*/
|
35968
35968
|
|
35969
35969
|
if (!pattern.complete && levels > section.length) {
|
@@ -36045,8 +36045,8 @@ var deep = createCommonjsModule(function (module, exports) {
|
|
36045
36045
|
}
|
36046
36046
|
|
36047
36047
|
_isSkippedByDeep(basePath, entryPath) {
|
36048
|
-
/**
|
36049
|
-
* Avoid unnecessary depth calculations when it doesn't matter.
|
36048
|
+
/**
|
36049
|
+
* Avoid unnecessary depth calculations when it doesn't matter.
|
36050
36050
|
*/
|
36051
36051
|
if (this._settings.deep === Infinity) {
|
36052
36052
|
return false;
|
@@ -36534,10 +36534,10 @@ async function FastGlob(source, options) {
|
|
36534
36534
|
function stream(source, options) {
|
36535
36535
|
assertPatternsInput(source);
|
36536
36536
|
const works = getWorks(source, stream$5.default, options);
|
36537
|
-
/**
|
36538
|
-
* The stream returned by the provider cannot work with an asynchronous iterator.
|
36539
|
-
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
36540
|
-
* This affects performance (+25%). I don't see best solution right now.
|
36537
|
+
/**
|
36538
|
+
* The stream returned by the provider cannot work with an asynchronous iterator.
|
36539
|
+
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
|
36540
|
+
* This affects performance (+25%). I don't see best solution right now.
|
36541
36541
|
*/
|
36542
36542
|
|
36543
36543
|
return utils$3.stream.merge(works);
|