prettier 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -1
  3. data/dist/haml/parser.rb +6 -0
  4. data/dist/parser/getInfo.js +9 -2
  5. data/dist/parser/server.rb +6 -2
  6. data/dist/rbs/parser.rb +59 -2
  7. data/dist/rbs/printer.js +14 -6
  8. data/dist/ruby/embed.js +10 -5
  9. data/dist/ruby/location.js +19 -0
  10. data/dist/ruby/nodes/alias.js +6 -5
  11. data/dist/ruby/nodes/aref.js +4 -6
  12. data/dist/ruby/nodes/args.js +29 -56
  13. data/dist/ruby/nodes/arrays.js +31 -35
  14. data/dist/ruby/nodes/assign.js +19 -23
  15. data/dist/ruby/nodes/blocks.js +18 -15
  16. data/dist/ruby/nodes/calls.js +33 -30
  17. data/dist/ruby/nodes/case.js +8 -8
  18. data/dist/ruby/nodes/class.js +13 -13
  19. data/dist/ruby/nodes/commands.js +36 -22
  20. data/dist/ruby/nodes/conditionals.js +56 -52
  21. data/dist/ruby/nodes/constants.js +10 -13
  22. data/dist/ruby/nodes/flow.js +39 -46
  23. data/dist/ruby/nodes/hashes.js +26 -30
  24. data/dist/ruby/nodes/heredocs.js +9 -9
  25. data/dist/ruby/nodes/hooks.js +2 -2
  26. data/dist/ruby/nodes/ints.js +5 -5
  27. data/dist/ruby/nodes/lambdas.js +7 -6
  28. data/dist/ruby/nodes/loops.js +26 -24
  29. data/dist/ruby/nodes/massign.js +22 -35
  30. data/dist/ruby/nodes/methods.js +20 -40
  31. data/dist/ruby/nodes/operators.js +26 -28
  32. data/dist/ruby/nodes/params.js +31 -25
  33. data/dist/ruby/nodes/patterns.js +34 -37
  34. data/dist/ruby/nodes/regexp.js +6 -6
  35. data/dist/ruby/nodes/rescue.js +23 -22
  36. data/dist/ruby/nodes/return.js +61 -36
  37. data/dist/ruby/nodes/statements.js +24 -25
  38. data/dist/ruby/nodes/strings.js +36 -34
  39. data/dist/ruby/nodes/super.js +6 -10
  40. data/dist/ruby/nodes/undef.js +19 -14
  41. data/dist/ruby/nodes.js +47 -21
  42. data/dist/ruby/parser.js +3 -2
  43. data/dist/ruby/parser.rb +8470 -2972
  44. data/dist/ruby/printer.js +9 -71
  45. data/dist/ruby/toProc.js +33 -35
  46. data/dist/types.js +5 -1
  47. data/dist/utils/containsAssignment.js +5 -2
  48. data/dist/utils/getChildNodes.js +305 -0
  49. data/dist/utils/inlineEnsureParens.js +1 -1
  50. data/dist/utils/isEmptyBodyStmt.js +1 -1
  51. data/dist/utils/isEmptyParams.js +12 -0
  52. data/dist/utils/isEmptyStmts.js +1 -1
  53. data/dist/utils/makeCall.js +5 -4
  54. data/dist/utils/printEmptyCollection.js +3 -1
  55. data/dist/utils/skipAssignIndent.js +6 -2
  56. data/dist/utils.js +5 -3
  57. data/lib/prettier.rb +2 -1
  58. data/node_modules/prettier/bin-prettier.js +48 -18924
  59. data/node_modules/prettier/cli.js +12335 -0
  60. data/node_modules/prettier/doc.js +1306 -4755
  61. data/node_modules/prettier/index.js +37468 -57614
  62. data/node_modules/prettier/package.json +3 -2
  63. data/node_modules/prettier/parser-angular.js +2 -66
  64. data/node_modules/prettier/parser-babel.js +27 -22
  65. data/node_modules/prettier/parser-espree.js +26 -22
  66. data/node_modules/prettier/parser-flow.js +26 -22
  67. data/node_modules/prettier/parser-glimmer.js +27 -1
  68. data/node_modules/prettier/parser-graphql.js +15 -1
  69. data/node_modules/prettier/parser-html.js +21 -117
  70. data/node_modules/prettier/parser-markdown.js +61 -19
  71. data/node_modules/prettier/parser-meriyah.js +19 -22
  72. data/node_modules/prettier/parser-postcss.js +76 -22
  73. data/node_modules/prettier/parser-typescript.js +280 -22
  74. data/node_modules/prettier/parser-yaml.js +150 -15
  75. data/node_modules/prettier/third-party.js +8660 -11030
  76. data/package.json +7 -7
  77. metadata +7 -3
data/dist/utils.js CHANGED
@@ -3,21 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.skipAssignIndent = exports.printEmptyCollection = exports.noIndent = exports.makeCall = exports.literallineWithoutBreakParent = exports.literal = exports.inlineEnsureParens = exports.hasAncestor = exports.isEmptyStmts = exports.isEmptyBodyStmt = exports.getTrailingComma = exports.containsAssignment = void 0;
6
+ exports.skipAssignIndent = exports.printEmptyCollection = exports.noIndent = exports.makeCall = exports.literallineWithoutBreakParent = exports.inlineEnsureParens = exports.hasAncestor = exports.getChildNodes = exports.isEmptyStmts = exports.isEmptyParams = exports.isEmptyBodyStmt = exports.getTrailingComma = exports.containsAssignment = void 0;
7
7
  var containsAssignment_1 = require("./utils/containsAssignment");
8
8
  Object.defineProperty(exports, "containsAssignment", { enumerable: true, get: function () { return __importDefault(containsAssignment_1).default; } });
9
9
  var getTrailingComma_1 = require("./utils/getTrailingComma");
10
10
  Object.defineProperty(exports, "getTrailingComma", { enumerable: true, get: function () { return __importDefault(getTrailingComma_1).default; } });
11
11
  var isEmptyBodyStmt_1 = require("./utils/isEmptyBodyStmt");
12
12
  Object.defineProperty(exports, "isEmptyBodyStmt", { enumerable: true, get: function () { return __importDefault(isEmptyBodyStmt_1).default; } });
13
+ var isEmptyParams_1 = require("./utils/isEmptyParams");
14
+ Object.defineProperty(exports, "isEmptyParams", { enumerable: true, get: function () { return __importDefault(isEmptyParams_1).default; } });
13
15
  var isEmptyStmts_1 = require("./utils/isEmptyStmts");
14
16
  Object.defineProperty(exports, "isEmptyStmts", { enumerable: true, get: function () { return __importDefault(isEmptyStmts_1).default; } });
17
+ var getChildNodes_1 = require("./utils/getChildNodes");
18
+ Object.defineProperty(exports, "getChildNodes", { enumerable: true, get: function () { return __importDefault(getChildNodes_1).default; } });
15
19
  var hasAncestor_1 = require("./utils/hasAncestor");
16
20
  Object.defineProperty(exports, "hasAncestor", { enumerable: true, get: function () { return __importDefault(hasAncestor_1).default; } });
17
21
  var inlineEnsureParens_1 = require("./utils/inlineEnsureParens");
18
22
  Object.defineProperty(exports, "inlineEnsureParens", { enumerable: true, get: function () { return __importDefault(inlineEnsureParens_1).default; } });
19
- var literal_1 = require("./utils/literal");
20
- Object.defineProperty(exports, "literal", { enumerable: true, get: function () { return __importDefault(literal_1).default; } });
21
23
  var literallineWithoutBreakParent_1 = require("./utils/literallineWithoutBreakParent");
22
24
  Object.defineProperty(exports, "literallineWithoutBreakParent", { enumerable: true, get: function () { return __importDefault(literallineWithoutBreakParent_1).default; } });
23
25
  var makeCall_1 = require("./utils/makeCall");
data/lib/prettier.rb CHANGED
@@ -12,7 +12,8 @@ module Prettier
12
12
  quoted = args.map { |arg| arg.start_with?('-') ? arg : "\"#{arg}\"" }
13
13
  command = "node #{BINARY} --plugin \"#{PLUGIN}\" #{quoted.join(' ')}"
14
14
 
15
- stdout, stderr, status = Open3.capture3({ 'RBPRETTIER' => '1' }, command)
15
+ stdout, stderr, status =
16
+ Open3.capture3({ 'RBPRETTIER' => '1' }, command, stdin_data: STDIN)
16
17
  STDOUT.puts(stdout)
17
18
 
18
19
  # If we completed successfully, then just exit out.