prettier 0.18.1 → 0.18.2
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 +14 -2
- data/LICENSE +1 -1
- data/README.md +9 -0
- data/node_modules/prettier/bin-prettier.js +1298 -373
- data/node_modules/prettier/index.js +1271 -346
- data/package.json +9 -2
- data/src/nodes/conditionals.js +2 -1
- data/src/nodes/rescue.js +5 -1
- data/src/ruby.js +2 -1
- metadata +2 -2
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prettier/plugin-ruby",
|
3
|
-
"version": "0.18.
|
3
|
+
"version": "0.18.2",
|
4
4
|
"description": "prettier plugin for the Ruby programming language",
|
5
5
|
"main": "src/ruby.js",
|
6
6
|
"scripts": {
|
@@ -25,7 +25,9 @@
|
|
25
25
|
"all-contributors-cli": "^6.14.1",
|
26
26
|
"eslint": "^6.8.0",
|
27
27
|
"eslint-config-prettier": "^6.10.1",
|
28
|
-
"
|
28
|
+
"husky": "^4.2.5",
|
29
|
+
"jest": "^25.2.7",
|
30
|
+
"pretty-quick": "^2.0.1"
|
29
31
|
},
|
30
32
|
"eslintConfig": {
|
31
33
|
"extends": [
|
@@ -53,6 +55,11 @@
|
|
53
55
|
],
|
54
56
|
"testRegex": ".test.js$"
|
55
57
|
},
|
58
|
+
"husky": {
|
59
|
+
"hooks": {
|
60
|
+
"pre-commit": "pretty-quick --staged"
|
61
|
+
}
|
62
|
+
},
|
56
63
|
"prettier": {
|
57
64
|
"trailingComma": "none"
|
58
65
|
}
|
data/src/nodes/conditionals.js
CHANGED
@@ -177,9 +177,10 @@ const canTernaryStmts = (stmts) => {
|
|
177
177
|
// additional node must have only one statement, and that statement list must
|
178
178
|
// pass the `canTernaryStmts` check.
|
179
179
|
const canTernary = (path) => {
|
180
|
-
const [
|
180
|
+
const [predicate, stmts, addition] = path.getValue().body;
|
181
181
|
|
182
182
|
return (
|
183
|
+
!["assign", "opassign"].includes(predicate.type) &&
|
183
184
|
addition &&
|
184
185
|
addition.type === "else" &&
|
185
186
|
[stmts, addition.body[0]].every(canTernaryStmts)
|
data/src/nodes/rescue.js
CHANGED
@@ -53,7 +53,11 @@ module.exports = {
|
|
53
53
|
parts.push(" StandardError");
|
54
54
|
}
|
55
55
|
|
56
|
-
|
56
|
+
const rescueBody = path.call(print, "body", 2);
|
57
|
+
|
58
|
+
if (rescueBody.parts.length > 0) {
|
59
|
+
parts.push(indent(concat([hardline, rescueBody])));
|
60
|
+
}
|
57
61
|
|
58
62
|
// This is the next clause on the `begin` statement, either another
|
59
63
|
// `rescue`, and `ensure`, or an `else` clause.
|
data/src/ruby.js
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prettier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Deisz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|