diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml new file mode 100644 index 0000000..af837f9 --- /dev/null +++ b/.github/linters/.eslintrc.yml @@ -0,0 +1,63 @@ +--- + +############################# +############################# +## JavaScript Linter rules ## +############################# +############################# + +############ +# Env Vars # +############ +env: + browser: true + es6: true + jest: true + +############### +# Global Vars # +############### +globals: + Atomics: readonly + SharedArrayBuffer: readonly + ####################################### + # Google Apps Script-specific classes # + ####################################### + # CalendarApp: readonly + # DocumentApp: readonly + # DriveApp: readonly + # FormApp: readonly + # GmailApp: readonly + # HtmlService: readonly + # MailApp: readonly + # PropertiesService: readonly + # ScriptApp: readonly + # Session: readonly + # SitesApp: readonly + # SlidesApp: readonly + # SpreadsheetApp: readonly + # UrlFetchApp: readonly + # Utilities: readonly + +############### +# Parser vars # +############### +parser: '@typescript-eslint/parser' +parserOptions: + ecmaVersion: 2018 + sourceType: script + +########### +# Plugins # +########### +extends: + - 'eslint:recommended' +plugins: + - '@typescript-eslint' + +######### +# Rules # +######### +rules: + no-useless-escape: warn + semi: error \ No newline at end of file diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1b7a8b3..57537bd 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,7 +16,7 @@ name: Lint Code Base ############################# on: push: - branches-ignore: [main] + # branches-ignore: [main] # Remove the line above to run when pushing to master pull_request: branches: [main] @@ -50,7 +50,7 @@ jobs: - name: Lint Code Base uses: github/super-linter@v3 env: - VALIDATE_ALL_CODEBASE: false + VALIDATE_ALL_CODEBASE: true VALIDATE_HTML: true VALIDATE_JAVASCRIPT_ES: true VALIDATE_JSON: true diff --git a/README.md b/README.md index 84972ac..75b1f2b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # openBD情報チェッカー(Google Chrome拡張機能) -![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jmbcpombnleepfponcjibgeohkfcocgg) [![GitHub Super-Linter](https://github.com/ttsukagoshi/chrome-ext_openBD-checker/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/ttsukagoshi/chrome-ext_openBD-checker.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ttsukagoshi/chrome-ext_openBD-checker/context:javascript) +![Chrome Web Store](https://img.shields.io/chrome-web-store/v/jmbcpombnleepfponcjibgeohkfcocgg) [![GitHub Super-Linter](https://github.com/ttsukagoshi/chrome-ext_openBD-checker/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) [![Total alerts](https://img.shields.io/lgtm/alerts/g/ttsukagoshi/chrome-ext_openBD-checker.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ttsukagoshi/chrome-ext_openBD-checker/alerts/) ウェブブラウザ(Chrome)内で選択したISBNコードに基づいて、コンテクストメニュー(右クリックメニュー)から[openBD](https://openbd.jp/)に登録されている情報を参照できるようにする拡張機能。 ## インストール diff --git a/src/background.js b/src/background.js index 7619c08..2fedda6 100644 --- a/src/background.js +++ b/src/background.js @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +/* global chrome */ + // Global variable(s) const OPENBD_API_VERSION = 'v1'; // openBDのAPIバージョン。 https://openbd.jp/ diff --git a/src/manifest.json b/src/manifest.json index 54b1563..7530152 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "openBD情報チェッカー", - "version": "1.2.4", + "version": "1.2.5", "description": "openBDに登録されている書誌・書影情報を、コンテクストメニューからISBNで検索・参照する。", "permissions": [ "contextMenus", diff --git a/src/result.js b/src/result.js index f0422b2..2cf16b0 100644 --- a/src/result.js +++ b/src/result.js @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +/* global chrome */ + window.addEventListener('load', function () { // openBD APIから取得した取得したデータをchrome.storageから読み込む chrome.storage.local.get(['openBdUrl', 'openBdResponse'], function (result) {