diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 0f2f486e8..3a4e0dd3b 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -7,8 +7,8 @@ BEFORE SUBMITTING AN ISSUE: If someone has already opened an issue for what you are experiencing,   you do not need to open a new issue — please add a 👍 reaction to the existing issue instead. - -2. We get a lot of requests for adding options, but Prettier is + +2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. This means we have a very high bar for adding new options. Find out more: https://prettier.io/docs/en/option-philosophy.html @@ -26,7 +26,7 @@ Tip! Don't write this stuff manually. --> -**Prettier 1.12.1** +**Prettier 1.13.0** [Playground link](https://prettier.io/playground/#.....) ```sh # Options (if any): diff --git a/CHANGELOG.md b/CHANGELOG.md index 162df14ae..61e6b706e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.13.0 + +[link](https://github.com/prettier/prettier/compare/1.12.1...1.13.0) + +* [Release Notes](https://prettier.io/blog/2018/05/23/1.13.0.html) + # 1.12.1 [link](https://github.com/prettier/prettier/compare/1.12.0...1.12.1) diff --git a/package.json b/package.json index 626b3f835..6fc0f9178 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "1.12.1", + "version": "1.13.0", "description": "Prettier is an opinionated code formatter", "bin": { "prettier": "./bin/prettier.js" diff --git a/tests_integration/__tests__/__snapshots__/schema.js.snap b/tests_integration/__tests__/__snapshots__/schema.js.snap index e721d9c3b..189e63228 100644 --- a/tests_integration/__tests__/__snapshots__/schema.js.snap +++ b/tests_integration/__tests__/__snapshots__/schema.js.snap @@ -59,7 +59,7 @@ This option cannot be used with --range-start and --range-end.", "type": "boolean", }, "parser": Object { - "default": "babylon", + "default": undefined, "description": "Which parser to use.", "oneOf": Array [ Object { @@ -104,6 +104,18 @@ This option cannot be used with --range-start and --range-end.", "json", ], }, + Object { + "description": "JSON5", + "enum": Array [ + "json5", + ], + }, + Object { + "description": "JSON.stringify", + "enum": Array [ + "json-stringify", + ], + }, Object { "description": "GraphQL", "enum": Array [ @@ -124,6 +136,16 @@ This option cannot be used with --range-start and --range-end.", }, ], }, + "pluginSearchDirs": Object { + "default": Array [], + "description": "Custom directory that contains prettier plugins in node_modules subdirectory. +Overrides default behavior when plugins are searched relatively to the location of Prettier. +Multiple values are accepted.", + "items": Object { + "type": "string", + }, + "type": "array", + }, "plugins": Object { "default": Array [], "description": "Add a plugin. Multiple plugins can be passed as separate \`--plugin\`s.", diff --git a/tests_integration/__tests__/__snapshots__/support-info.js.snap b/tests_integration/__tests__/__snapshots__/support-info.js.snap index 0d334fc86..c0d166046 100644 --- a/tests_integration/__tests__/__snapshots__/support-info.js.snap +++ b/tests_integration/__tests__/__snapshots__/support-info.js.snap @@ -395,7 +395,24 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` - First value + Second value -@@ -27,12 +27,23 @@ +@@ -7,10 +7,16 @@ + \\"graphql\\", + ], + \\"JSON\\": Array [ + \\"json\\", + ], ++ \\"JSON.stringify\\": Array [ ++ \\"json-stringify\\", ++ ], ++ \\"JSON5\\": Array [ ++ \\"json5\\", ++ ], + \\"JSX\\": Array [ + \\"babylon\\", + \\"flow\\", + ], + \\"JavaScript\\": Array [ +@@ -27,12 +33,23 @@ \\"scss\\", ], \\"TypeScript\\": Array [ @@ -419,17 +436,26 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"type\\": \\"boolean\\", }, \\"cursorOffset\\": Object { -@@ -65,14 +76,19 @@ +@@ -63,16 +80,27 @@ + \\"typescript\\", + \\"css\\", \\"less\\", \\"scss\\", \\"json\\", ++ \\"json5\\", ++ \\"json-stringify\\", \\"graphql\\", \\"markdown\\", + \\"vue\\", ], - \\"default\\": \\"babylon\\", +- \\"default\\": \\"babylon\\", ++ \\"default\\": undefined, \\"type\\": \\"choice\\", }, ++ \\"pluginSearchDirs\\": Object { ++ \\"default\\": Array [], ++ \\"type\\": \\"path\\", ++ }, + \\"plugins\\": Object { + \\"default\\": Array [], + \\"type\\": \\"path\\", @@ -439,7 +465,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"range\\": Object { \\"end\\": Infinity, \\"start\\": 0, -@@ -80,14 +96,15 @@ +@@ -80,14 +108,15 @@ }, \\"type\\": \\"int\\", }, @@ -528,6 +554,20 @@ exports[`CLI --support-info (stdout) 1`] = ` \\"tmScope\\": \\"source.ts\\", \\"vscodeLanguageIds\\": [\\"typescript\\", \\"typescriptreact\\"] }, + { + \\"aceMode\\": \\"json\\", + \\"codemirrorMimeType\\": \\"application/json\\", + \\"codemirrorMode\\": \\"javascript\\", + \\"extensions\\": [], + \\"filenames\\": [\\"package.json\\", \\"package-lock.json\\", \\"composer.json\\"], + \\"group\\": \\"JavaScript\\", + \\"linguistLanguageId\\": 174, + \\"name\\": \\"JSON.stringify\\", + \\"parsers\\": [\\"json-stringify\\"], + \\"since\\": \\"1.13.0\\", + \\"tmScope\\": \\"source.json\\", + \\"vscodeLanguageIds\\": [\\"json\\"] + }, { \\"aceMode\\": \\"json\\", \\"codemirrorMimeType\\": \\"application/json\\", @@ -549,6 +589,20 @@ exports[`CLI --support-info (stdout) 1`] = ` \\"tmScope\\": \\"source.json\\", \\"vscodeLanguageIds\\": [\\"json\\", \\"jsonc\\"] }, + { + \\"aceMode\\": \\"json\\", + \\"codemirrorMimeType\\": \\"application/json\\", + \\"codemirrorMode\\": \\"javascript\\", + \\"extensions\\": [\\".json5\\"], + \\"filenames\\": [\\".babelrc\\"], + \\"group\\": \\"JavaScript\\", + \\"linguistLanguageId\\": 175, + \\"name\\": \\"JSON5\\", + \\"parsers\\": [\\"json5\\"], + \\"since\\": \\"1.13.0\\", + \\"tmScope\\": \\"source.json\\", + \\"vscodeLanguageIds\\": [\\"json5\\"] + }, { \\"aceMode\\": \\"css\\", \\"codemirrorMimeType\\": \\"text/css\\", @@ -721,17 +775,33 @@ exports[`CLI --support-info (stdout) 1`] = ` { \\"description\\": \\"Less\\", \\"since\\": \\"1.7.1\\", \\"value\\": \\"less\\" }, { \\"description\\": \\"SCSS\\", \\"since\\": \\"1.7.1\\", \\"value\\": \\"scss\\" }, { \\"description\\": \\"JSON\\", \\"since\\": \\"1.5.0\\", \\"value\\": \\"json\\" }, + { \\"description\\": \\"JSON5\\", \\"since\\": \\"1.13.0\\", \\"value\\": \\"json5\\" }, + { + \\"description\\": \\"JSON.stringify\\", + \\"since\\": \\"1.13.0\\", + \\"value\\": \\"json-stringify\\" + }, { \\"description\\": \\"GraphQL\\", \\"since\\": \\"1.5.0\\", \\"value\\": \\"graphql\\" }, { \\"description\\": \\"Markdown\\", \\"since\\": \\"1.8.0\\", \\"value\\": \\"markdown\\" }, { \\"description\\": \\"Vue\\", \\"since\\": \\"1.10.0\\", \\"value\\": \\"vue\\" } ], - \\"default\\": \\"babylon\\", \\"description\\": \\"Which parser to use.\\", \\"name\\": \\"parser\\", \\"pluginDefaults\\": {}, \\"since\\": \\"0.0.10\\", \\"type\\": \\"choice\\" }, + { + \\"array\\": true, + \\"category\\": \\"Global\\", + \\"default\\": [], + \\"description\\": + \\"Custom directory that contains prettier plugins in node_modules subdirectory.\\\\nOverrides default behavior when plugins are searched relatively to the location of Prettier.\\\\nMultiple values are accepted.\\", + \\"name\\": \\"pluginSearchDirs\\", + \\"pluginDefaults\\": {}, + \\"since\\": \\"1.13.0\\", + \\"type\\": \\"path\\" + }, { \\"array\\": true, \\"category\\": \\"Global\\",