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/codechecks.js.yml similarity index 66% rename from .github/workflows/unittests.js.yml rename to .github/workflows/codechecks.js.yml index b52381f7..c6def19b 100644 --- a/.github/workflows/unittests.js.yml +++ b/.github/workflows/codechecks.js.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: @@ -19,10 +19,15 @@ jobs: node-version: [14.x] steps: - - uses: actions/checkout@v2 - - name: Run unit tests + - name: Checkout project source + uses: actions/checkout@v2 + - name: Install tools uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - run: npm install --also=dev - - run: npm test + - name: Install project dependencies + 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", diff --git a/src/domain/navigation/URLRouter.js b/src/domain/navigation/URLRouter.js index b38791a0..28488129 100644 --- a/src/domain/navigation/URLRouter.js +++ b/src/domain/navigation/URLRouter.js @@ -86,7 +86,7 @@ export class URLRouter { tryRestoreLastUrl() { const lastNavPath = this._urlAsNavPath(this._history.getLastUrl() || ""); if (lastNavPath.segments.length !== 0) { - this._applyNavPathToNavigation(navPath); + this._applyNavPathToNavigation(lastNavPath); return true; } return false;