From 12bddae20c0bd6c31c53ec44656868f21ec5aca7 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 24 Jan 2021 01:14:13 +0800 Subject: [PATCH] Switch default branch to `main` (#10115) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/dev-test.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/prod-test.yml | 6 +++--- README.md | 6 +++--- changelog_unreleased/TEMPLATE.md | 2 +- changelog_unreleased/api/9733.md | 2 +- changelog_unreleased/css/9966.md | 2 +- changelog_unreleased/flow/9767.md | 2 +- changelog_unreleased/handlebars/9082.md | 2 +- changelog_unreleased/handlebars/9978.md | 2 +- changelog_unreleased/html/7865.md | 2 +- changelog_unreleased/javascript/10085.md | 2 +- changelog_unreleased/javascript/9672.md | 2 +- changelog_unreleased/javascript/9704.md | 2 +- changelog_unreleased/javascript/9711.md | 2 +- changelog_unreleased/javascript/9743.md | 2 +- changelog_unreleased/javascript/9787.md | 2 +- changelog_unreleased/javascript/9850.md | 2 +- changelog_unreleased/javascript/9866.md | 2 +- changelog_unreleased/markdown/9736.md | 2 +- changelog_unreleased/markdown/9791.md | 2 +- changelog_unreleased/scss/9710.md | 2 +- changelog_unreleased/typescript/9872.md | 2 +- docs/plugins.md | 2 +- docs/technical-details.md | 2 +- scripts/draft-blog-post.js | 2 +- scripts/lint-changelog.js | 6 ++++++ scripts/release/release.js | 4 +++- scripts/release/steps/bump-prettier.js | 10 +++++++--- .../better-parent-property-check-in-needs-parens.js | 2 +- .../directly-loc-start-end.js | 2 +- .../jsx-identifier-case.js | 2 +- .../no-doc-builder-concat.js | 2 +- .../no-node-comments.js | 2 +- .../prefer-fast-path-each.js | 2 +- .../prefer-is-non-empty-array.js | 2 +- .../require-json-extensions.js | 2 +- src/common/common-options.js | 2 +- src/language-css/options.js | 2 +- src/language-graphql/options.js | 2 +- src/language-html/options.js | 2 +- src/language-js/options.js | 2 +- src/language-js/print/html-binding.js | 2 +- src/language-markdown/options.js | 2 +- src/language-yaml/options.js | 2 +- website/pages/en/index.js | 2 +- website/pages/en/versions.js | 12 ++++++------ website/playground/VersionLink.js | 2 +- website/siteConfig.js | 2 +- website/versioned_docs/version-stable/plugins.md | 2 +- .../version-stable/technical-details.md | 2 +- 52 files changed, 74 insertions(+), 62 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4f0d98099..9cac6f57f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ - [ ] I’ve added tests to confirm my change works. - [ ] (If changing the API or CLI) I’ve documented the changes I’ve made (in the `docs/` directory). - [ ] (If the change is user-facing) I’ve added my changes to `changelog_unreleased/*/XXXX.md` file following `changelog_unreleased/TEMPLATE.md`. -- [ ] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md). +- [ ] I’ve read the [contributing guidelines](https://github.com/prettier/prettier/blob/main/CONTRIBUTING.md). diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 033660dfb..10758dee7 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -3,7 +3,7 @@ name: Dev on: push: branches: - - master + - main - patch-release pull_request: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0984a8e3e..cdd7d5105 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: Lint on: push: branches: - - master + - main - patch-release pull_request: diff --git a/.github/workflows/prod-test.yml b/.github/workflows/prod-test.yml index 7dad9639b..2776158f5 100644 --- a/.github/workflows/prod-test.yml +++ b/.github/workflows/prod-test.yml @@ -3,7 +3,7 @@ name: Prod on: push: branches: - - master + - main - patch-release pull_request: @@ -30,7 +30,7 @@ jobs: restore-keys: | v2-build-cache-${{ hashFiles('yarn.lock') }}-${{ hashFiles('scripts/build/**/*') }}-${{ github.ref }}- v2-build-cache-${{ hashFiles('yarn.lock') }}-${{ hashFiles('scripts/build/**/*') }}-refs/heads/${{ github.base_ref }}- - v2-build-cache-${{ hashFiles('yarn.lock') }}-${{ hashFiles('scripts/build/**/*') }}-refs/heads/master- + v2-build-cache-${{ hashFiles('yarn.lock') }}-${{ hashFiles('scripts/build/**/*') }}-refs/heads/main- - name: Build Package run: yarn build @@ -43,7 +43,7 @@ jobs: # This step calls `git reset` # It should be the last step - # The cache step might saving the result of master branch, need investigate + # The cache step might saving the result of main branch, need investigate - name: Check Sizes if: github.event_name == 'pull_request' && startsWith(github.head_ref, 'dependabot/npm_and_yarn/') uses: preactjs/compressed-size-action@2.1.0 diff --git a/README.md b/README.md index 76f2e0406..189df95a6 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,11 @@

- + Github Actions Build Status - + Github Actions Build Status - + Github Actions Build Status Codecov Coverage Status diff --git a/changelog_unreleased/TEMPLATE.md b/changelog_unreleased/TEMPLATE.md index 4e961c104..24d07c16d 100644 --- a/changelog_unreleased/TEMPLATE.md +++ b/changelog_unreleased/TEMPLATE.md @@ -34,6 +34,6 @@ // Prettier stable foo ?? baz || baz; -// Prettier master +// Prettier main (foo ?? baz) || baz; ``` diff --git a/changelog_unreleased/api/9733.md b/changelog_unreleased/api/9733.md index 0c903d057..3b4f8369b 100644 --- a/changelog_unreleased/api/9733.md +++ b/changelog_unreleased/api/9733.md @@ -8,6 +8,6 @@ If you're a plugin author, this change should only concern you if your plugin in // Prettier stable myDoc = group(concat(["foo", line, "bar"])); -// Prettier master +// Prettier main myDoc = group(["foo", line, "bar"]); ``` diff --git a/changelog_unreleased/css/9966.md b/changelog_unreleased/css/9966.md index 7bf310eda..1e64d1d1b 100644 --- a/changelog_unreleased/css/9966.md +++ b/changelog_unreleased/css/9966.md @@ -9,6 +9,6 @@ The CSS parser is parsing this as `["division", "absolute/path"]` instead of a s /* Prettier stable */ -custom-url(/ absolute/path) -/* Prettier master */ +/* Prettier main */ -custom-url(/absolute/path) ``` diff --git a/changelog_unreleased/flow/9767.md b/changelog_unreleased/flow/9767.md index bcc28c110..295391284 100644 --- a/changelog_unreleased/flow/9767.md +++ b/changelog_unreleased/flow/9767.md @@ -10,6 +10,6 @@ declare export * from "ES6_ExportAllFrom_Source2"; // Prettier stable declare export * from "ES6_ExportAllFrom_Source2" -// Prettier master +// Prettier main declare export * from "ES6_ExportAllFrom_Source2"; ``` diff --git a/changelog_unreleased/handlebars/9082.md b/changelog_unreleased/handlebars/9082.md index 5c9d6070f..00adb39d9 100644 --- a/changelog_unreleased/handlebars/9082.md +++ b/changelog_unreleased/handlebars/9082.md @@ -12,7 +12,7 @@ {{! Comment }} {{! Comment }} -{{!-- Prettier master --}} +{{!-- Prettier main --}} {{~! Comment }} {{! Comment ~}} {{~! Comment ~}} diff --git a/changelog_unreleased/handlebars/9978.md b/changelog_unreleased/handlebars/9978.md index e4de4cfc5..acd3a9c96 100644 --- a/changelog_unreleased/handlebars/9978.md +++ b/changelog_unreleased/handlebars/9978.md @@ -23,7 +23,7 @@ Hello {{/block}} -{{!-- Prettier master --}} +{{!-- Prettier main --}} - +

1 | foo("a", , "b"); [error] | ^ diff --git a/changelog_unreleased/javascript/9850.md b/changelog_unreleased/javascript/9850.md index 313a6c192..7a0476f1d 100644 --- a/changelog_unreleased/javascript/9850.md +++ b/changelog_unreleased/javascript/9850.md @@ -20,7 +20,7 @@ function foo() { "use strict";; } -// Prettier master +// Prettier main // prettier-ignore 'use strict'; diff --git a/changelog_unreleased/javascript/9866.md b/changelog_unreleased/javascript/9866.md index 72ebe84c4..21b837a62 100644 --- a/changelog_unreleased/javascript/9866.md +++ b/changelog_unreleased/javascript/9866.md @@ -21,7 +21,7 @@ //----- ^ U+3000 --------------- ^ U+3000

; -// Prettier master +// Prettier main

 {this.props.data.title}  //----- ^ U+3000 --------------- ^ U+3000 diff --git a/changelog_unreleased/markdown/9736.md b/changelog_unreleased/markdown/9736.md index d60d80679..a96744438 100644 --- a/changelog_unreleased/markdown/9736.md +++ b/changelog_unreleased/markdown/9736.md @@ -17,7 +17,7 @@ Markdown ``` - + Markdown ```js diff --git a/changelog_unreleased/markdown/9791.md b/changelog_unreleased/markdown/9791.md index 983136a64..b23ad3027 100644 --- a/changelog_unreleased/markdown/9791.md +++ b/changelog_unreleased/markdown/9791.md @@ -28,7 +28,7 @@ a|b|c| text - + --- --- diff --git a/changelog_unreleased/scss/9710.md b/changelog_unreleased/scss/9710.md index ca92c1a21..a729dddf0 100644 --- a/changelog_unreleased/scss/9710.md +++ b/changelog_unreleased/scss/9710.md @@ -14,7 +14,7 @@ foo: (calc() // not a comment anymore); } -// Prettier master +// Prettier main .simplification { foo: ( calc() // not a comment anymore diff --git a/changelog_unreleased/typescript/9872.md b/changelog_unreleased/typescript/9872.md index 1ee6d2c9b..a36125ff5 100644 --- a/changelog_unreleased/typescript/9872.md +++ b/changelog_unreleased/typescript/9872.md @@ -12,7 +12,7 @@ class Foo { // Prettier stable Error: Comment "bat" was not printed. Please report this error! -// Prettier master +// Prettier main class Foo { bar /* bat */(); } diff --git a/docs/plugins.md b/docs/plugins.md index 152b87209..8795c1905 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -167,7 +167,7 @@ export const printers = { #### The printing process -Prettier uses an intermediate representation, called a Doc, which Prettier then turns into a string (based on options like `printWidth`). A _printer_'s job is to take the AST generated by `parsers[].parse` and return a Doc. A Doc is constructed using [builder commands](https://github.com/prettier/prettier/blob/master/commands.md): +Prettier uses an intermediate representation, called a Doc, which Prettier then turns into a string (based on options like `printWidth`). A _printer_'s job is to take the AST generated by `parsers[].parse` and return a Doc. A Doc is constructed using [builder commands](https://github.com/prettier/prettier/blob/main/commands.md): ```js const { join, line, ifBreak, group } = require("prettier").doc.builders; diff --git a/docs/technical-details.md b/docs/technical-details.md index bd67937ca..1a6b44ae5 100644 --- a/docs/technical-details.md +++ b/docs/technical-details.md @@ -9,4 +9,4 @@ The basic idea is that the printer takes an AST and returns an intermediate repr This means that most of the logic of printing an AST involves generating an abstract representation of the output involving certain commands. For example, `["(", line, arg, line, ")"]` would represent a concatenation of opening parens, an argument, and closing parens. But if that doesn’t fit on one line, the printer can break where `line` is specified. -More (rough) details can be found in [commands.md](https://github.com/prettier/prettier/blob/master/commands.md). +More (rough) details can be found in [commands.md](https://github.com/prettier/prettier/blob/main/commands.md). diff --git a/scripts/draft-blog-post.js b/scripts/draft-blog-post.js index 512b6ea07..2aabeb955 100644 --- a/scripts/draft-blog-post.js +++ b/scripts/draft-blog-post.js @@ -140,5 +140,5 @@ function formatVersion(version) { function replaceVersions(data) { return data .replace(/prettier stable/gi, `Prettier ${formatVersion(previousVersion)}`) - .replace(/prettier master/gi, `Prettier ${formatVersion(version)}`); + .replace(/prettier main/gi, `Prettier ${formatVersion(version)}`); } diff --git a/scripts/lint-changelog.js b/scripts/lint-changelog.js index f7548a247..d4003248e 100644 --- a/scripts/lint-changelog.js +++ b/scripts/lint-changelog.js @@ -144,5 +144,11 @@ for (const category of CHANGELOG_CATEGORIES) { `[${displayPath}]: Please put one space between title and PR link.` ); } + + if (/prettier master/i.test(content)) { + showErrorMessage( + `[${displayPath}]: Please use "main" instead of "master".` + ); + } } } diff --git a/scripts/release/release.js b/scripts/release/release.js index aa35bc222..f063191be 100644 --- a/scripts/release/release.js +++ b/scripts/release/release.js @@ -26,7 +26,9 @@ async function run() { throw new Error(`Unexpected previousVersion: ${previousVersion}`); } else { params.previousVersion = previousVersion; - params.previousVersionOnMaster = (await readJson("package.json")).version; + params.previousVersionOnDefaultBranch = ( + await readJson("package.json") + ).version; } const steps = [ diff --git a/scripts/release/steps/bump-prettier.js b/scripts/release/steps/bump-prettier.js index c965586ab..05e1f54ee 100644 --- a/scripts/release/steps/bump-prettier.js +++ b/scripts/release/steps/bump-prettier.js @@ -29,10 +29,14 @@ async function commit(version) { await execa("git", ["push"]); } -async function bump({ version, previousVersion, previousVersionOnMaster }) { +async function bump({ + version, + previousVersion, + previousVersionOnDefaultBranch, +}) { const pkg = await readJson("package.json"); if (semver.diff(version, previousVersion) === "patch") { - pkg.version = previousVersionOnMaster; // restore the `-dev` version + pkg.version = previousVersionOnDefaultBranch; // restore the `-dev` version } else { pkg.version = semver.inc(version, "minor") + "-dev"; } @@ -52,6 +56,6 @@ module.exports = async function (params) { ); await logPromise("Updating files", format()); - await logPromise("Bump master version", bump(params)); + await logPromise("Bump default branch version", bump(params)); await logPromise("Committing changed files", commit(version)); }; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js b/scripts/tools/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js index 0346e4212..5a42c23e1 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js @@ -49,7 +49,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/better-parent-property-check-in-needs-parens.js", }, messages: { [MESSAGE_ID_PREFER_NAME_CHECK]: diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js b/scripts/tools/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js index 1e2618637..667098ef1 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js @@ -14,7 +14,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/directly-loc-start-end.js", }, messages: { [MESSAGE_ID]: diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js b/scripts/tools/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js index c1063a416..2d313e1d3 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js @@ -10,7 +10,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/jsx-identifier-case.js", }, messages: { [MESSAGE_ID]: "Please rename '{{name}}' to '{{fixed}}'.", diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js index ab0b83d12..3afec100e 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js @@ -14,7 +14,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-doc-builder-concat.js", }, messages: { [messageId]: "Use array directly instead of `concat([])`", diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-node-comments.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-node-comments.js index 493549b52..45fb65dce 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/no-node-comments.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-node-comments.js @@ -30,7 +30,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/no-node-comments.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-node-comments.js", }, messages: { [messageId]: "Do not access node.comments.", diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-fast-path-each.js b/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-fast-path-each.js index f4d6ad97d..12bd32ed4 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-fast-path-each.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-fast-path-each.js @@ -21,7 +21,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/require-json-extensions.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/require-json-extensions.js", }, messages: { [messageId]: "Prefer `FastPath#each()` over `FastPath#map()`.", diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js b/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js index 81fe8932e..68bdb80c4 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js @@ -57,7 +57,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/prefer-is-non-empty-array.js", }, messages: { [MESSAGE_ID]: "Please use `isNonEmptyArray()`.", diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/require-json-extensions.js b/scripts/tools/eslint-plugin-prettier-internal-rules/require-json-extensions.js index 281602f50..01e773fe5 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/require-json-extensions.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/require-json-extensions.js @@ -27,7 +27,7 @@ module.exports = { type: "suggestion", docs: { url: - "https://github.com/prettier/prettier/blob/master/scripts/eslint-plugin-prettier-internal-rules/require-json-extensions.js", + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/require-json-extensions.js", }, messages: { [MESSAGE_ID]: 'Missing file extension ".json" for "{{id}}".', diff --git a/src/common/common-options.js b/src/common/common-options.js index c81add613..db53d344b 100644 --- a/src/common/common-options.js +++ b/src/common/common-options.js @@ -2,7 +2,7 @@ const CATEGORY_COMMON = "Common"; -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { bracketSpacing: { since: "0.0.0", diff --git a/src/language-css/options.js b/src/language-css/options.js index b84b11071..357fa26f2 100644 --- a/src/language-css/options.js +++ b/src/language-css/options.js @@ -2,7 +2,7 @@ const commonOptions = require("../common/common-options"); -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { singleQuote: commonOptions.singleQuote, }; diff --git a/src/language-graphql/options.js b/src/language-graphql/options.js index c0ff84541..cfe076dd4 100644 --- a/src/language-graphql/options.js +++ b/src/language-graphql/options.js @@ -2,7 +2,7 @@ const commonOptions = require("../common/common-options"); -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { bracketSpacing: commonOptions.bracketSpacing, }; diff --git a/src/language-html/options.js b/src/language-html/options.js index f0e290a4a..22285b34f 100644 --- a/src/language-html/options.js +++ b/src/language-html/options.js @@ -2,7 +2,7 @@ const CATEGORY_HTML = "HTML"; -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { htmlWhitespaceSensitivity: { since: "1.15.0", diff --git a/src/language-js/options.js b/src/language-js/options.js index 7dea5b00d..775d7c7ee 100644 --- a/src/language-js/options.js +++ b/src/language-js/options.js @@ -4,7 +4,7 @@ const commonOptions = require("../common/common-options"); const CATEGORY_JAVASCRIPT = "JavaScript"; -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { arrowParens: { since: "1.9.0", diff --git a/src/language-js/print/html-binding.js b/src/language-js/print/html-binding.js index 17d988686..61a5d8cee 100644 --- a/src/language-js/print/html-binding.js +++ b/src/language-js/print/html-binding.js @@ -47,7 +47,7 @@ function printHtmlBinding(path, options, print) { } } -// based on https://github.com/prettier/prettier/blob/master/src/language-html/syntax-vue.js isVueEventBindingExpression() +// based on https://github.com/prettier/prettier/blob/main/src/language-html/syntax-vue.js isVueEventBindingExpression() function isVueEventBindingExpression(node) { switch (node.type) { case "MemberExpression": diff --git a/src/language-markdown/options.js b/src/language-markdown/options.js index 11d40f10d..87e20f73c 100644 --- a/src/language-markdown/options.js +++ b/src/language-markdown/options.js @@ -2,7 +2,7 @@ const commonOptions = require("../common/common-options"); -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { proseWrap: commonOptions.proseWrap, singleQuote: commonOptions.singleQuote, diff --git a/src/language-yaml/options.js b/src/language-yaml/options.js index 7f5ad6652..a25c8cde7 100644 --- a/src/language-yaml/options.js +++ b/src/language-yaml/options.js @@ -2,7 +2,7 @@ const commonOptions = require("../common/common-options"); -// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js +// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.js module.exports = { bracketSpacing: commonOptions.bracketSpacing, singleQuote: commonOptions.singleQuote, diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 300ca865d..0a212f30d 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -229,7 +229,7 @@ const EditorSupportSection = () => (

Got more? Send a PR diff --git a/website/pages/en/versions.js b/website/pages/en/versions.js index c7f82c186..0ac98cdc4 100755 --- a/website/pages/en/versions.js +++ b/website/pages/en/versions.js @@ -15,12 +15,12 @@ const CWD = process.cwd(); const versions = require(`${CWD}/versions.json`); const rootPackageJson = require(`${CWD}/../package.json`); -const masterVersion = rootPackageJson.version; -const isMasterDevVersion = masterVersion.endsWith("-dev"); -const devVersion = isMasterDevVersion ? masterVersion : null; -const latestVersion = isMasterDevVersion +const defaultBranchVersion = rootPackageJson.version; +const isDefaultBranchDevVersion = defaultBranchVersion.endsWith("-dev"); +const devVersion = isDefaultBranchDevVersion ? defaultBranchVersion : null; +const latestVersion = isDefaultBranchDevVersion ? rootPackageJson.devDependencies.prettier - : masterVersion; + : defaultBranchVersion; const [latestDocsVersion, ...pastDocsVersions] = versions; function Versions(props) { @@ -60,7 +60,7 @@ function Versions(props) { next {" "} - (master) + (main) {pastDocsVersions.length > 0 && diff --git a/website/playground/VersionLink.js b/website/playground/VersionLink.js index 4a5a33939..e466ef312 100644 --- a/website/playground/VersionLink.js +++ b/website/playground/VersionLink.js @@ -11,7 +11,7 @@ export default function ({ version }) { } else if (/\.0$/.test(version)) { href = `releases/tag/${version}`; } else { - href = `blob/master/CHANGELOG.md#${version.replace(/\./g, "")}`; + href = `blob/main/CHANGELOG.md#${version.replace(/\./g, "")}`; } const formattedVersion = match ? `PR #${match[1]}` : `v${version}`; diff --git a/website/siteConfig.js b/website/siteConfig.js index b05b342e0..b4d93ab11 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -32,7 +32,7 @@ const siteConfig = { tideliftUrl: "https://tidelift.com/subscription/pkg/npm-prettier?utm_source=npm-prettier&utm_medium=referral&utm_campaign=website", /* base url for editing docs, usage example: editUrl + 'en/doc1.md' */ - editUrl: `${GITHUB_URL}/edit/master/docs/`, + editUrl: `${GITHUB_URL}/edit/main/docs/`, headerLinks: [ { href: "/playground/", label: "Playground" }, { doc: "index", label: "Docs" }, diff --git a/website/versioned_docs/version-stable/plugins.md b/website/versioned_docs/version-stable/plugins.md index 61cba34b0..ac88ebdaa 100644 --- a/website/versioned_docs/version-stable/plugins.md +++ b/website/versioned_docs/version-stable/plugins.md @@ -168,7 +168,7 @@ export const printers = { #### The printing process -Prettier uses an intermediate representation, called a Doc, which Prettier then turns into a string (based on options like `printWidth`). A _printer_'s job is to take the AST generated by `parsers[].parse` and return a Doc. A Doc is constructed using [builder commands](https://github.com/prettier/prettier/blob/master/commands.md): +Prettier uses an intermediate representation, called a Doc, which Prettier then turns into a string (based on options like `printWidth`). A _printer_'s job is to take the AST generated by `parsers[].parse` and return a Doc. A Doc is constructed using [builder commands](https://github.com/prettier/prettier/blob/main/commands.md): ```js const { concat, join, line, ifBreak, group } = require("prettier").doc.builders; diff --git a/website/versioned_docs/version-stable/technical-details.md b/website/versioned_docs/version-stable/technical-details.md index 64aff50e8..1615bdca5 100644 --- a/website/versioned_docs/version-stable/technical-details.md +++ b/website/versioned_docs/version-stable/technical-details.md @@ -10,4 +10,4 @@ The basic idea is that the printer takes an AST and returns an intermediate repr This means that most of the logic of printing an AST involves generating an abstract representation of the output involving certain commands. For example, `concat(["(", line, arg, line, ")"])` would represent a concatenation of opening parens, an argument, and closing parens. But if that doesn’t fit on one line, the printer can break where `line` is specified. -More (rough) details can be found in [commands.md](https://github.com/prettier/prettier/blob/master/commands.md). +More (rough) details can be found in [commands.md](https://github.com/prettier/prettier/blob/main/commands.md).