From 5e811dcf4c001ca7a8bab2a76143ca8e4e27b091 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 16 Sep 2022 22:52:36 -0500 Subject: [PATCH 1/5] Sort scripts alphabetically --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index af42f63..e8c534b 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "prettier": "^2.4.1" }, "scripts": { - "lint": "eslint src", - "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt && ncc build src/pre.js -o pre --source-map --license licenses.txt", - "test": "jest", + "all": "npm run format && npm run lint && npm run prepare && npm run test", "format": "prettier --write 'src/**/*.js'", "format:check": "prettier --check 'src/**/*.js'", - "all": "npm run format && npm run lint && npm run prepare && npm run test" + "lint": "eslint src", + "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt && ncc build src/pre.js -o pre --source-map --license licenses.txt", + "test": "jest" }, "repository": { "type": "git", From de75c272ff548d7e7485f733bac06bda9753e839 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 16 Sep 2022 22:52:58 -0500 Subject: [PATCH 2/5] Expand ESLint usage and add check script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e8c534b..3113d15 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "all": "npm run format && npm run lint && npm run prepare && npm run test", "format": "prettier --write 'src/**/*.js'", "format:check": "prettier --check 'src/**/*.js'", - "lint": "eslint src", + "lint": "DEBUG=eslint:cli-engine eslint --fix .", + "lint:check": "DEBUG=eslint:cli-engine eslint .", "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt && ncc build src/pre.js -o pre --source-map --license licenses.txt", "test": "jest" }, From f8491fe25ca89a6d3fca34a058525e33f4a1c173 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 16 Sep 2022 22:59:17 -0500 Subject: [PATCH 3/5] Enhance ESLint configuration --- .eslintignore | 2 -- .eslintrc.json | 20 +++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b947077..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -dist/ diff --git a/.eslintrc.json b/.eslintrc.json index 3036622..dd68910 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,19 +1,17 @@ { "env": { "commonjs": true, - "es6": true, - "jest": true, - "node": true - }, - "extends": "eslint:recommended", - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" + "es2021": true, + "node": true, + "jest": true }, + "plugins": ["github"], + "extends": ["eslint:recommended", "prettier", "plugin:github/internal"], "parserOptions": { - "ecmaVersion": 2020 + "ecmaVersion": 12 }, "rules": { "semi": ["error", "never"] - } -} \ No newline at end of file + }, + "ignorePatterns": ["/dist/", "/pre/"] +} From 503d9f28e74fe1945615a4757415ff2529069a6c Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 16 Sep 2022 23:05:43 -0500 Subject: [PATCH 4/5] Remove redundant require for global variables --- src/index.test.js | 2 -- src/pre.test.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/index.test.js b/src/index.test.js index d70c20c..1d6f867 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -5,8 +5,6 @@ const path = require('path') const nock = require('nock') const axios = require('axios') -const { expect, jest } = require('@jest/globals') - const { Deployment } = require('./deployment') describe('with all environment variables set', () => { diff --git a/src/pre.test.js b/src/pre.test.js index 82069be..7a45999 100644 --- a/src/pre.test.js +++ b/src/pre.test.js @@ -2,8 +2,6 @@ const core = require('@actions/core') const process = require('process') const axios = require('axios') -const { expect, jest } = require('@jest/globals') - const { emitTelemetry } = require('./pre') describe('emitTelemetry', () => { From 6e7a81b68fbc8e90974917b68afd4868c59cdaa2 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 16 Sep 2022 23:16:38 -0500 Subject: [PATCH 5/5] Revise linter Actions workflow --- .github/workflows/check-linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-linter.yml b/.github/workflows/check-linter.yml index 7e801a5..9c0f870 100644 --- a/.github/workflows/check-linter.yml +++ b/.github/workflows/check-linter.yml @@ -1,4 +1,4 @@ -name: Checking linter +name: Check linter on: push: @@ -31,4 +31,4 @@ jobs: run: npm ci - name: Verify linter - run: npm run lint \ No newline at end of file + run: npm run lint:check