Skip to content

Commit

Permalink
Update configuration for eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Apr 22, 2024
1 parent e92cb75 commit 6ab3329
Show file tree
Hide file tree
Showing 10 changed files with 39,751 additions and 58,139 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Yarn install
node-version: 20
- name: Npm install
run: |
cd ./scripts
yarn install
npm install
- name: Run eslint
run: make jslint
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ scripts/golangci-lint: Makefile

## jslint: enforce a consistent code style for Js code
jslint: scripts/node_modules
@scripts/node_modules/.bin/eslint -c scripts/eslintrc.json "assets/scripts/**" tests/system/konnector/*.js
@scripts/node_modules/.bin/eslint -c scripts/eslint.config.js "assets/scripts/**" tests/system/konnector/*.js
.PHONY: jslint

## pretty: make the assets prettier
Expand All @@ -44,8 +44,8 @@ svgo: scripts/node_modules
@scripts/node_modules/.bin/svgo -r -f assets/icons
@scripts/node_modules/.bin/svgo -r -f assets/images --exclude relocation-animated.svg

scripts/node_modules: Makefile scripts/package.json scripts/yarn.lock
@cd scripts && yarn
scripts/node_modules: Makefile scripts/package.json scripts/package-lock.json
@cd scripts && npm install

## assets: package the assets as go code
assets: web/statik/statik.go
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const deviceToken = storage.getItem('trusted-device-token') || ''
trustedTokenInput.value = deviceToken
} catch (e) {
// do nothing
console.log(e) // do nothing
}

const onSubmitPassphrase = function (event) {
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/oidc-twofactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const deviceToken = storage.getItem('trusted-device-token') || ''
trustedTokenInput.value = deviceToken
} catch (e) {
// do nothing
console.log(e) // do nothing
}

form.submit()
Expand Down
8 changes: 8 additions & 0 deletions scripts/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import globals from "globals";
import pluginJs from "@eslint/js";

export default [
{ files: ["**/*.js"], languageOptions: { sourceType: "script" } },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
];
11 changes: 0 additions & 11 deletions scripts/eslintrc.json

This file was deleted.

Loading

0 comments on commit 6ab3329

Please sign in to comment.