From fe992b662685e96de92ed7c5660ddcac3a9727c2 Mon Sep 17 00:00:00 2001 From: S Nitesh Singh Date: Tue, 14 Sep 2021 16:16:15 +0530 Subject: [PATCH 1/5] Chore: migrate master to main --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 4 ++-- Makefile.js | 10 +++++----- docs/developer-guide/code-path-analysis.md | 10 +++++----- docs/developer-guide/contributing/pull-requests.md | 6 +++--- docs/developer-guide/working-with-rules-deprecated.md | 4 ++-- docs/developer-guide/working-with-rules.md | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f0d6c3e2ed9..683421c0db2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ #### Prerequisites checklist -- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/master/CONTRIBUTING.md). +- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/main/CONTRIBUTING.md). #### What is the purpose of this pull request? (put an "X" next to an item) @@ -16,9 +16,9 @@ --> [ ] Documentation update -[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/bug-report.md)) -[ ] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-proposal.md)) -[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-change-proposal.md)) +[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/bug-report.md)) +[ ] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/rule-proposal.md)) +[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/rule-change-proposal.md)) [ ] Add autofixing to a rule [ ] Add a CLI option [ ] Add something to the core diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf15885f021..3aafacc8cc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: CI on: push: - branches: [master] + branches: [main] pull_request: - branches: [master] + branches: [main] jobs: verify_files: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 127c24dc754..ae4cbb0b610 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [ main ] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [ main ] schedule: - cron: '28 17 * * 5' diff --git a/Makefile.js b/Makefile.js index c2d3442f5bd..4a545c4eee2 100644 --- a/Makefile.js +++ b/Makefile.js @@ -236,7 +236,7 @@ function commitSiteToGit(tag) { exec(`git tag ${tag}`); } - exec("git fetch origin && git rebase origin/master"); + exec("git fetch origin && git rebase origin/main"); cd(currentDir); } @@ -249,7 +249,7 @@ function publishSite() { const currentDir = pwd(); cd(SITE_DIR); - exec("git push origin master --tags"); + exec("git push origin main --tags"); cd(currentDir); } @@ -647,8 +647,8 @@ target.gensite = function(prereleaseVersion) { tempFiles.forEach((filename, i) => { if (test("-f", filename) && path.extname(filename) === ".md") { - const rulesUrl = "https://github.com/eslint/eslint/tree/master/lib/rules/", - docsUrl = "https://github.com/eslint/eslint/tree/master/docs/rules/", + const rulesUrl = "https://github.com/eslint/eslint/tree/main/lib/rules/", + docsUrl = "https://github.com/eslint/eslint/tree/main/docs/rules/", baseName = path.basename(filename), sourceBaseName = `${path.basename(filename, ".md")}.js`, sourcePath = path.join("lib/rules", sourceBaseName), @@ -695,7 +695,7 @@ target.gensite = function(prereleaseVersion) { "---", `title: ${title}`, "layout: doc", - `edit_link: https://github.com/eslint/eslint/edit/master/${filePath}`, + `edit_link: https://github.com/eslint/eslint/edit/main/${filePath}`, ruleType, "---", "", diff --git a/docs/developer-guide/code-path-analysis.md b/docs/developer-guide/code-path-analysis.md index f1f96be9c31..1e67b48d391 100644 --- a/docs/developer-guide/code-path-analysis.md +++ b/docs/developer-guide/code-path-analysis.md @@ -226,9 +226,9 @@ module.exports = function(context) { ``` See Also: -[no-unreachable](https://github.com/eslint/eslint/blob/master/lib/rules/no-unreachable.js), -[no-fallthrough](https://github.com/eslint/eslint/blob/master/lib/rules/no-fallthrough.js), -[consistent-return](https://github.com/eslint/eslint/blob/master/lib/rules/consistent-return.js) +[no-unreachable](https://github.com/eslint/eslint/blob/main/lib/rules/no-unreachable.js), +[no-fallthrough](https://github.com/eslint/eslint/blob/main/lib/rules/no-fallthrough.js), +[consistent-return](https://github.com/eslint/eslint/blob/main/lib/rules/consistent-return.js) ### To check state of a code path @@ -324,8 +324,8 @@ module.exports = function(context) { ``` See Also: -[constructor-super](https://github.com/eslint/eslint/blob/master/lib/rules/constructor-super.js), -[no-this-before-super](https://github.com/eslint/eslint/blob/master/lib/rules/no-this-before-super.js) +[constructor-super](https://github.com/eslint/eslint/blob/main/lib/rules/constructor-super.js), +[no-this-before-super](https://github.com/eslint/eslint/blob/main/lib/rules/no-this-before-super.js) ## Code Path Examples diff --git a/docs/developer-guide/contributing/pull-requests.md b/docs/developer-guide/contributing/pull-requests.md index ef4169e23d0..e75ca5acb9a 100644 --- a/docs/developer-guide/contributing/pull-requests.md +++ b/docs/developer-guide/contributing/pull-requests.md @@ -88,7 +88,7 @@ Before you send the pull request, be sure to rebase onto the upstream source. Th ``` git fetch upstream -git rebase upstream/master +git rebase upstream/main ``` ### Step 4: Run the tests @@ -164,7 +164,7 @@ $ git commit $ git push origin issue1234 ``` -When updating the code, it's usually better to add additional commits to your branch rather than amending the original commit, because reviewers can easily tell which changes were made in response to a particular review. When we merge pull requests, we will squash all the commits from your branch into a single commit on the `master` branch. +When updating the code, it's usually better to add additional commits to your branch rather than amending the original commit, because reviewers can easily tell which changes were made in response to a particular review. When we merge pull requests, we will squash all the commits from your branch into a single commit on the `main` branch. ### Rebasing @@ -172,7 +172,7 @@ If your code is out-of-date, we might ask you to rebase. That means we want you ``` $ git fetch upstream -$ git rebase upstream/master +$ git rebase upstream/main ``` You might find that there are merge conflicts when you attempt to rebase. Please [resolve the conflicts](https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/) and then do a forced push to your branch: diff --git a/docs/developer-guide/working-with-rules-deprecated.md b/docs/developer-guide/working-with-rules-deprecated.md index 5265cb50e79..63d7bb2fc69 100644 --- a/docs/developer-guide/working-with-rules-deprecated.md +++ b/docs/developer-guide/working-with-rules-deprecated.md @@ -493,8 +493,8 @@ To keep the linting process efficient and unobtrusive, it is useful to verify th The `npm run perf` command gives a high-level overview of ESLint running time with default rules (`eslint:recommended`) enabled. ```bash -$ git checkout master -Switched to branch 'master' +$ git checkout main +Switched to branch 'main' $ npm run perf CPU Speed is 2200 with multiplier 7500000 diff --git a/docs/developer-guide/working-with-rules.md b/docs/developer-guide/working-with-rules.md index 3da1731d5f1..c6be2686610 100644 --- a/docs/developer-guide/working-with-rules.md +++ b/docs/developer-guide/working-with-rules.md @@ -674,8 +674,8 @@ To keep the linting process efficient and unobtrusive, it is useful to verify th When developing in the ESLint core repository, the `npm run perf` command gives a high-level overview of ESLint running time with all core rules enabled. ```bash -$ git checkout master -Switched to branch 'master' +$ git checkout main +Switched to branch 'main' $ npm run perf CPU Speed is 2200 with multiplier 7500000 From 8018286c7ff3eb1358caa3d48d24fed304dcb6ab Mon Sep 17 00:00:00 2001 From: Nitesh Seram Date: Tue, 14 Sep 2021 19:53:10 +0530 Subject: [PATCH 2/5] fix: keep the branch name to master for website repo Co-authored-by: Milos Djermanovic --- Makefile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.js b/Makefile.js index 4a545c4eee2..7a4c1777849 100644 --- a/Makefile.js +++ b/Makefile.js @@ -236,7 +236,7 @@ function commitSiteToGit(tag) { exec(`git tag ${tag}`); } - exec("git fetch origin && git rebase origin/main"); + exec("git fetch origin && git rebase origin/master"); cd(currentDir); } @@ -249,7 +249,7 @@ function publishSite() { const currentDir = pwd(); cd(SITE_DIR); - exec("git push origin main --tags"); + exec("git push origin master --tags"); cd(currentDir); } From 2996845bd49e16d39a495fcffc52a5186363d3cf Mon Sep 17 00:00:00 2001 From: S Nitesh Singh Date: Wed, 15 Sep 2021 10:16:58 +0530 Subject: [PATCH 3/5] Fix: replace main branch in URL with HEAD --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++---- Makefile.js | 6 +++--- docs/developer-guide/code-path-analysis.md | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 683421c0db2..e15677eada1 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ #### Prerequisites checklist -- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/main/CONTRIBUTING.md). +- [ ] I have read the [contributing guidelines](https://github.com/eslint/eslint/blob/HEAD/CONTRIBUTING.md). #### What is the purpose of this pull request? (put an "X" next to an item) @@ -16,9 +16,9 @@ --> [ ] Documentation update -[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/bug-report.md)) -[ ] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/rule-proposal.md)) -[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/main/templates/rule-change-proposal.md)) +[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/HEAD/templates/bug-report.md)) +[ ] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/HEAD/templates/rule-proposal.md)) +[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/HEAD/templates/rule-change-proposal.md)) [ ] Add autofixing to a rule [ ] Add a CLI option [ ] Add something to the core diff --git a/Makefile.js b/Makefile.js index 7a4c1777849..c577ab5b552 100644 --- a/Makefile.js +++ b/Makefile.js @@ -647,8 +647,8 @@ target.gensite = function(prereleaseVersion) { tempFiles.forEach((filename, i) => { if (test("-f", filename) && path.extname(filename) === ".md") { - const rulesUrl = "https://github.com/eslint/eslint/tree/main/lib/rules/", - docsUrl = "https://github.com/eslint/eslint/tree/main/docs/rules/", + const rulesUrl = "https://github.com/eslint/eslint/tree/HEAD/lib/rules/", + docsUrl = "https://github.com/eslint/eslint/tree/HEAD/docs/rules/", baseName = path.basename(filename), sourceBaseName = `${path.basename(filename, ".md")}.js`, sourcePath = path.join("lib/rules", sourceBaseName), @@ -695,7 +695,7 @@ target.gensite = function(prereleaseVersion) { "---", `title: ${title}`, "layout: doc", - `edit_link: https://github.com/eslint/eslint/edit/main/${filePath}`, + `edit_link: https://github.com/eslint/eslint/edit/HEAD/${filePath}`, ruleType, "---", "", diff --git a/docs/developer-guide/code-path-analysis.md b/docs/developer-guide/code-path-analysis.md index 1e67b48d391..3507ff64142 100644 --- a/docs/developer-guide/code-path-analysis.md +++ b/docs/developer-guide/code-path-analysis.md @@ -226,9 +226,9 @@ module.exports = function(context) { ``` See Also: -[no-unreachable](https://github.com/eslint/eslint/blob/main/lib/rules/no-unreachable.js), -[no-fallthrough](https://github.com/eslint/eslint/blob/main/lib/rules/no-fallthrough.js), -[consistent-return](https://github.com/eslint/eslint/blob/main/lib/rules/consistent-return.js) +[no-unreachable](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-unreachable.js), +[no-fallthrough](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-fallthrough.js), +[consistent-return](https://github.com/eslint/eslint/blob/HEAD/lib/rules/consistent-return.js) ### To check state of a code path @@ -324,8 +324,8 @@ module.exports = function(context) { ``` See Also: -[constructor-super](https://github.com/eslint/eslint/blob/main/lib/rules/constructor-super.js), -[no-this-before-super](https://github.com/eslint/eslint/blob/main/lib/rules/no-this-before-super.js) +[constructor-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/constructor-super.js), +[no-this-before-super](https://github.com/eslint/eslint/blob/HEAD/lib/rules/no-this-before-super.js) ## Code Path Examples From 2313cb1d0c0be4dec38080c8773ea715fa96fe67 Mon Sep 17 00:00:00 2001 From: Nitesh Seram Date: Wed, 15 Sep 2021 11:21:19 +0530 Subject: [PATCH 4/5] Fix: add both master and main branch in Github workflow Co-authored-by: Jordan Harband --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3aafacc8cc1..56dcf00485a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: CI on: push: - branches: [main] + branches: [master, main] pull_request: - branches: [main] + branches: [master, main] jobs: verify_files: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ae4cbb0b610..ef362a4b64d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [master, main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [master, main] schedule: - cron: '28 17 * * 5' From 40cf1f75bd00bcf19844b9022c7a78f33fd24bc3 Mon Sep 17 00:00:00 2001 From: Nitesh Seram Date: Tue, 21 Sep 2021 09:30:56 +0530 Subject: [PATCH 5/5] Fix: make the branch name to main for edit url --- Makefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.js b/Makefile.js index c577ab5b552..4e25ce3ae17 100644 --- a/Makefile.js +++ b/Makefile.js @@ -695,7 +695,7 @@ target.gensite = function(prereleaseVersion) { "---", `title: ${title}`, "layout: doc", - `edit_link: https://github.com/eslint/eslint/edit/HEAD/${filePath}`, + `edit_link: https://github.com/eslint/eslint/edit/main/${filePath}`, ruleType, "---", "",