From bf5c7353d2b9f90f3a3de5c22d1fc23770da610c Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Wed, 15 Dec 2021 12:35:34 -0500 Subject: [PATCH] eslint check the .github/actions-scripts/* files too (#23698) * eslint check the .github/actions-scripts/* files too * but ignore node_modules/.bin/* * fix errors * last one * feedbacked --- .eslintrc.js | 2 +- .github/actions-scripts/fr-add-docs-reviewers-requests.js | 4 ++-- .github/actions-scripts/ready-for-docs-review.js | 4 ++-- .github/workflows/code-lint.yml | 1 + package-lock.json | 1 + package.json | 1 + 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 976cdf2adf..6b20dc82b7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,7 +13,7 @@ module.exports = { babelOptions: { configFile: './.babelrc' }, sourceType: 'module', }, - ignorePatterns: ['tmp/*'], + ignorePatterns: ['tmp/*', '!/.*', '/.next/'], rules: { 'import/no-extraneous-dependencies': ['error', { packageDir: '.' }], }, diff --git a/.github/actions-scripts/fr-add-docs-reviewers-requests.js b/.github/actions-scripts/fr-add-docs-reviewers-requests.js index 23beb67617..a095d10628 100644 --- a/.github/actions-scripts/fr-add-docs-reviewers-requests.js +++ b/.github/actions-scripts/fr-add-docs-reviewers-requests.js @@ -134,8 +134,8 @@ async function run() { // Exclude existing items going forward. // Until we have a way to check from a PR whether the PR is in a project, // this is how we (roughly) avoid overwriting PRs that are already on the board - let newItemIDs = [] - let newItemAuthors = [] + const newItemIDs = [] + const newItemAuthors = [] itemIDs.forEach((id, index) => { if (!existingItemIDs.includes(id)) { newItemIDs.push(id) diff --git a/.github/actions-scripts/ready-for-docs-review.js b/.github/actions-scripts/ready-for-docs-review.js index 4bbc186a5d..3271a60d3c 100644 --- a/.github/actions-scripts/ready-for-docs-review.js +++ b/.github/actions-scripts/ready-for-docs-review.js @@ -85,8 +85,8 @@ async function run() { // - affected docs sets (not considering changes to data/assets) let numFiles = 0 let numChanges = 0 - let features = new Set([]) - const files = data.item.files.nodes.forEach((node) => { + const features = new Set([]) + data.item.files.nodes.forEach((node) => { numFiles += 1 numChanges += node.additions numChanges += node.deletions diff --git a/.github/workflows/code-lint.yml b/.github/workflows/code-lint.yml index b4ff63a0ea..dffadffb7d 100644 --- a/.github/workflows/code-lint.yml +++ b/.github/workflows/code-lint.yml @@ -18,6 +18,7 @@ on: - '**.yaml' - '**.yml' - '**.scss' + - .eslintrc.js # In case something like eslint or tsc or prettier upgrades - 'package-lock.json' # Ultimately, for debugging this workflow itself diff --git a/package-lock.json b/package-lock.json index 513523b4aa..4c024ca009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -103,6 +103,7 @@ "@graphql-inspector/core": "^2.9.0", "@graphql-tools/load": "^7.4.1", "@jest/globals": "^27.3.1", + "@octokit/graphql": "4.8.0", "@octokit/rest": "^18.12.0", "@types/github-slugger": "^1.3.0", "@types/imurmurhash": "^0.1.1", diff --git a/package.json b/package.json index b148086fc8..c9c70c070e 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "@graphql-inspector/core": "^2.9.0", "@graphql-tools/load": "^7.4.1", "@jest/globals": "^27.3.1", + "@octokit/graphql": "4.8.0", "@octokit/rest": "^18.12.0", "@types/github-slugger": "^1.3.0", "@types/imurmurhash": "^0.1.1",