From 4feb9eb210f8c612dd5cff61ba1745d94a86f47a Mon Sep 17 00:00:00 2001 From: uiolee <22849383+uiolee@users.noreply.github.com> Date: Sat, 26 Aug 2023 10:26:03 +0800 Subject: [PATCH 1/3] update eslint --- .eslintrc.json | 13 +++++++------ .github/workflows/lint.yml | 23 +++++++++++++++++++++++ .travis.yml | 3 --- package.json | 11 +++++------ 4 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .travis.yml diff --git a/.eslintrc.json b/.eslintrc.json index 22a593cb..e371120e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,22 +1,23 @@ { "root": true, "parserOptions": { - "ecmaVersion": 2017 + "ecmaVersion": "latest" }, "env": { "browser": true, - "es6": true, + "es2021": true, + "node": true, "webextensions": true }, "globals": { "globalThis": false }, - "extends": [ - "eslint:recommended" - ], + "extends": ["eslint:recommended"], + "overrides": [], + "rules": { "no-console": 0, - "no-unused-vars": ["warn", { "vars": "all", "args": "after-used" } ], + "no-unused-vars": ["warn", { "vars": "all", "args": "after-used" }], "no-undef": ["warn"], "no-proto": ["error"], "prefer-arrow-callback": ["warn"], diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..3018e7e5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: lint +on: + pull_request: + paths: + - '**.js?' + +jobs: + eslint: + name: eslint + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/checkout@v3 + + - uses: reviewdog/action-eslint@v1 + with: + reporter: github-pr-review + eslint_flags: "." + filter_mode: "file" + fail_on_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6892e2f8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: stable -sudo: false diff --git a/package.json b/package.json index a47007c4..54df96d1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "version": "1.0.0", "description": "Example Firefox add-ons created using the WebExtensions API", "devDependencies": { - "eslint": "^4.4.1" + "@babel/eslint-parser": "^7.22.11", + "eslint": "^8.48.0" }, "repository": { "type": "git", @@ -12,7 +13,8 @@ }, "scripts": { "test": "eslint .", - "lint": "eslint ." + "lint": "eslint .", + "lint:fix": "eslint . --fix" }, "license": "MIT", "bugs": { @@ -25,8 +27,5 @@ "firefox", "mozilla" ], - "homepage": "https://developer.mozilla.org/Add-ons/WebExtensions/Examples", - "dependencies": { - "babel-eslint": "^7.2.3" - } + "homepage": "https://developer.mozilla.org/Add-ons/WebExtensions/Examples" } From 4b631bf2d20700d5e17bd35b80f4fb174173c6eb Mon Sep 17 00:00:00 2001 From: uiolee <22849383+uiolee@users.noreply.github.com> Date: Sat, 26 Aug 2023 10:30:45 +0800 Subject: [PATCH 2/3] babel-eslint has been deprecated --- store-collected-images/webextension-plain/.eslintrc | 2 +- store-collected-images/webextension-with-webpack/.eslintrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/store-collected-images/webextension-plain/.eslintrc b/store-collected-images/webextension-plain/.eslintrc index f0310c8d..6b126708 100644 --- a/store-collected-images/webextension-plain/.eslintrc +++ b/store-collected-images/webextension-plain/.eslintrc @@ -1,3 +1,3 @@ { - "parser": "babel-eslint" + "parser": "@babel/eslint-parser" } \ No newline at end of file diff --git a/store-collected-images/webextension-with-webpack/.eslintrc b/store-collected-images/webextension-with-webpack/.eslintrc index 1adf9764..6c7d7299 100644 --- a/store-collected-images/webextension-with-webpack/.eslintrc +++ b/store-collected-images/webextension-with-webpack/.eslintrc @@ -1,5 +1,5 @@ { - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "env": { "commonjs": true } From 82ac5e83b4684f0547e24ac758a8f6eae9fccd49 Mon Sep 17 00:00:00 2001 From: uiolee <22849383+uiolee@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:34:44 +0800 Subject: [PATCH 3/3] ci: update lint --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3018e7e5..59035b7b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,7 +2,7 @@ name: lint on: pull_request: paths: - - '**.js?' + - "**.js" jobs: eslint: @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: reviewdog/action-eslint@v1 with: