From 6515a7ebe98962e2f0582f72647071e2699e6499 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 25 Feb 2020 00:58:33 +0800 Subject: [PATCH] Remove deprecated options (#7536) --- changelog_unreleased/api/pr-7536.md | 4 ++++ src/common/common-options.js | 4 +--- src/language-js/options.js | 4 +--- .../__tests__/__snapshots__/arg-parsing.js.snap | 12 ------------ tests_integration/__tests__/arg-parsing.js | 11 ----------- 5 files changed, 6 insertions(+), 29 deletions(-) create mode 100644 changelog_unreleased/api/pr-7536.md diff --git a/changelog_unreleased/api/pr-7536.md b/changelog_unreleased/api/pr-7536.md new file mode 100644 index 000000000..7156efd0b --- /dev/null +++ b/changelog_unreleased/api/pr-7536.md @@ -0,0 +1,4 @@ +#### Remove deprecated options ([#7536](https://github.com/prettier/prettier/pull/7536) by [@fisker](https://github.com/fisker)) + +`trailingComma` choices `true`(rename to `always` since _v1.9.0_) / `false`(rename to `never` since _v1.9.0_) is removed.\ +`proseWrap` choices `true`(rename to `es5` since _v0.19.0_) / `false`(rename to `none` since _0.19.0_) is removed. diff --git a/src/common/common-options.js b/src/common/common-options.js index 3a4012f91..f2ddcb2c9 100644 --- a/src/common/common-options.js +++ b/src/common/common-options.js @@ -43,9 +43,7 @@ module.exports = { since: "1.9.0", value: "preserve", description: "Wrap prose as-is." - }, - { value: false, deprecated: "1.9.0", redirect: "never" }, - { value: true, deprecated: "1.9.0", redirect: "always" } + } ] } }; diff --git a/src/language-js/options.js b/src/language-js/options.js index b794a452b..568cd648b 100644 --- a/src/language-js/options.js +++ b/src/language-js/options.js @@ -94,9 +94,7 @@ module.exports = { value: "all", description: "Trailing commas wherever possible (including function arguments)." - }, - { value: true, deprecated: "0.19.0", redirect: "es5" }, - { value: false, deprecated: "0.19.0", redirect: "none" } + } ] } }; diff --git a/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap b/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap index aed335000..eb38f8c6b 100644 --- a/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap +++ b/tests_integration/__tests__/__snapshots__/arg-parsing.js.snap @@ -13,18 +13,6 @@ exports[`boolean flags do not swallow the next argument (stdout) 1`] = ` exports[`boolean flags do not swallow the next argument (write) 1`] = `Array []`; -exports[`deprecated option values are warned (stderr) 1`] = ` -"[warn] --trailing-comma without an argument is deprecated; we now treat it as --trailing-comma=es5. -" -`; - -exports[`deprecated option values are warned (stdout) 1`] = ` -"console.log(\\"could be single quote and without semi\\"); -" -`; - -exports[`deprecated option values are warned (write) 1`] = `Array []`; - exports[`deprecated options are warned (stderr) 1`] = ` "[warn] --flow-parser is deprecated; we now treat it as --parser=flow. " diff --git a/tests_integration/__tests__/arg-parsing.js b/tests_integration/__tests__/arg-parsing.js index 936663ab7..8dd82f00d 100644 --- a/tests_integration/__tests__/arg-parsing.js +++ b/tests_integration/__tests__/arg-parsing.js @@ -57,17 +57,6 @@ describe("deprecated options are warned", () => { }); }); -describe("deprecated option values are warned", () => { - runPrettier("cli/arg-parsing", [ - "--end-of-line", - "lf", - "file.js", - "--trailing-comma" - ]).test({ - status: 0 - }); -}); - describe("allow overriding flags", () => { runPrettier( "cli/arg-parsing",