From fa7e24fed76b496f00b77a03d24163be4221d141 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 20 May 2021 11:11:57 +0200 Subject: [PATCH] tune linting so it doesn't produce errors anymore and enable in CI --- .eslintignore | 1 + .eslintrc.js | 4 +++- .github/workflows/{unittests.js.yml => checks.yml} | 7 +++++-- .gitignore | 1 + package.json | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .eslintignore rename .github/workflows/{unittests.js.yml => checks.yml} (85%) diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..732865cb --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/matrix/storage/memory \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 8ed0e1a7..2a14eac6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,8 @@ module.exports = { }, "rules": { "no-console": "off", - "no-empty": "off" + "no-empty": "off", + "no-prototype-builtins": "off", + "no-unused-vars": "warn", } }; diff --git a/.github/workflows/unittests.js.yml b/.github/workflows/checks.yml similarity index 85% rename from .github/workflows/unittests.js.yml rename to .github/workflows/checks.yml index b52381f7..e5d3f95c 100644 --- a/.github/workflows/unittests.js.yml +++ b/.github/workflows/checks.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Unit tests +name: Code checks on: push: @@ -20,9 +20,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Run unit tests + - name: Install uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm install --also=dev + - name: Unit tests - run: npm test + - name: Lint + - run: npm run lint-ci \ No newline at end of file diff --git a/.gitignore b/.gitignore index bd1c201e..7f6220cf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ bundle.js target lib *.tar.gz +.eslintcache \ No newline at end of file diff --git a/package.json b/package.json index 3e69a0be..34f08269 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "doc": "doc" }, "scripts": { - "lint": "eslint src/", + "lint": "eslint --cache src/", + "lint-ci": "eslint src/", "test": "impunity --entry-point src/main.js --force-esm-dirs lib/ src/", "start": "node scripts/serve-local.js", "build": "node --experimental-modules scripts/build.mjs",