From 6e2c4465a45f4e05cdee717b18e7c80efb043d9e Mon Sep 17 00:00:00 2001 From: Valdo Ryu Date: Thu, 31 Oct 2024 15:42:10 +0100 Subject: [PATCH] ci: replace github linter by local eslint command --- .github/workflows/lint.yml | 22 +++++----------------- content/content.css | 3 ++- content/content.js | 14 ++++++++------ package.json | 3 ++- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 65f10b0..4a98d3f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,21 +8,9 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Lint Codebase - uses: github/super-linter@v4 - env: - LINTER_RULES_PATH: / - JAVASCRIPT_ES_CONFIG_FILE: .eslintrc - VALIDATE_ALL_CODEBASE: false - VALIDATE_JAVASCRIPT_STANDARD: false - VALIDATE_CSS: false - VALIDATE_JSCPD: false - DEFAULT_BRANCH: main - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v2 + - name: Install modules + run: yarn + - name: Run ESLint + run: yarn lint diff --git a/content/content.css b/content/content.css index c40a74c..58e57bf 100644 --- a/content/content.css +++ b/content/content.css @@ -20,7 +20,8 @@ position: relative !important; } -.dim:not(:hover) > * > * > * { +.dim:not(:hover) >, +* > * > * { max-height: 150px !important; overflow: hidden !important; } diff --git a/content/content.js b/content/content.js index 5267bb1..a5761b3 100644 --- a/content/content.js +++ b/content/content.js @@ -171,22 +171,24 @@ async function toggleFeed(shown) { let attempts = 0 let success = false let className = 'scaffold-finite-scroll__content' // feed element css class - if (window.location.href != 'https://www.linkedin.com/feed/'){ + if (window.location.href != 'https://www.linkedin.com/feed/') { // dont hide this element on notifications & jobs page. Only hide on home feed instead. return } while (!success && attempts < 50) { await new Promise((resolve) => { - setTimeout(() => { + setTimeout(() => { if (shown) { document - .getElementsByClassName(className).item(0) - .classList.add('hide') + .getElementsByClassName(className) + .item(0) + .classList.add('hide') console.log(`LinkOff: feed disabled`) } else { document - .getElementsByClassName(className).item(0) - .classList.remove('hide') + .getElementsByClassName(className) + .item(0) + .classList.remove('hide') console.log(`LinkOff: feed enabled`) } success = true diff --git a/package.json b/package.json index 40d2171..4d0f729 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "scripts": { "css-build": "node-sass --omit-source-map-url popup/popup.scss popup/popup.css", "css-watch": "npm run css-build -- --watch", - "start": "npm run css-watch" + "start": "npm run css-watch", + "lint": "eslint . --ignore-path .eslintignore" }, "devDependencies": { "@creativebulma/bulma-divider": "^1.1.0",