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",