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 49d85ec..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"] - } + }, + "ignorePatterns": ["/dist/", "/pre/"] } diff --git a/.github/workflows/check-linter.yml b/.github/workflows/check-linter.yml index 202d375..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 + run: npm run lint:check diff --git a/package.json b/package.json index 6197d38..c5765b8 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,13 @@ "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 .", "format:check": "prettier --check .", - "all": "npm run format && npm run lint && npm run prepare && npm run test" + "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" }, "repository": { "type": "git", 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', () => {