From 7ff2ca954c1d31f80b01eef59a96bfee30809211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Tue, 27 Dec 2022 19:57:55 +0100 Subject: [PATCH] Adding eslint to github actions --- .github/workflows/main.yml | 3 +++ app/server/lib/HostedStorageManager.ts | 2 +- package.json | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 136f4d82..e871b332 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,6 +46,9 @@ jobs: - name: Build Node.js code run: yarn run build:prod + - name: Run eslint + run: yarn run lint:ci + - name: Run smoke test run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:smoke diff --git a/app/server/lib/HostedStorageManager.ts b/app/server/lib/HostedStorageManager.ts index fe18cb1d..30f64298 100644 --- a/app/server/lib/HostedStorageManager.ts +++ b/app/server/lib/HostedStorageManager.ts @@ -923,7 +923,7 @@ export async function backupSqliteDatabase(src: string, dest: string, } finally { if (testProgress) { testProgress({action: 'close', phase: 'before'}); } try { - if (db) { await fromCallback(cb => db.close(cb)); } + if (db) { await fromCallback(cb => db!.close(cb)); } } catch (err) { _log.debug(null, `problem stopping copy of ${src} (${label}): ${err}`); } diff --git a/package.json b/package.json index a1912df9..f46141f9 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,9 @@ "test:python": "sandbox_venv3/bin/python sandbox/grist/runtests.py ${GREP_TESTS:+discover -p \"test*${GREP_TESTS}*.py\"}", "cli": "NODE_PATH=_build:_build/stubs:_build/ext node _build/app/server/companion.js", "lint": "eslint --cache --cache-strategy content .", - "lint:fix": "eslint --cache --cache-strategy content --fix .", - "generate:translation": "NODE_PATH=_build:_build/stubs:_build/ext node buildtools/generate_translation_keys.js" + "lint:fix": "eslint --cache --cache-strategy=content --fix .", + "lint:ci": "eslint --max-warnings=0 .", + "generate:translation": "NODE_PATH=_build:_build/stubs:_build/ext node buildtools/generate_translation_keys.js", }, "keywords": [ "grist",