From: Jérôme Benoit Date: Mon, 15 Jul 2024 15:31:29 +0000 (+0200) Subject: chore: configuration cleanups after migration to eslint flat config X-Git-Tag: ocpp-server@v1.5.0~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f3c5c4c4196b4bf22bfcbbd72c559bebc7bdb584;p=e-mobility-charging-stations-simulator.git chore: configuration cleanups after migration to eslint flat config Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 870993ef..5b0072f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,9 +127,10 @@ jobs: - name: pnpm audit if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} run: pnpm audit --prod - - name: pnpm lint - if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} - run: pnpm lint + # TODO: needs flat config support in vue.js eslint plugins + # - name: pnpm lint + # if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} + # run: pnpm lint - name: pnpm build run: pnpm build - name: pnpm test diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 27d7dfed..45396f97 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,6 +1,7 @@ export default { '{src,tests}/**/*.{ts,tsx,cts,mts}': [ - /* 'prettier --cache --write', 'eslint --cache --fix' */ + // 'prettier --cache --write', + 'eslint --cache --fix', ], '**/*.{json,md,yml,yaml}': ['prettier --cache --write'], '**/*.{js,jsx,cjs,mjs}': ['prettier --cache --write', 'eslint --cache --fix'], diff --git a/eslint.config.js b/eslint.config.js index c9c6fa53..d9c7cc30 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -50,6 +50,7 @@ export default defineFlatConfig([ }, { files: [ + 'src/charging-station/Bootstrap.ts', 'src/charging-station/ChargingStation.ts', 'src/charging-station/ocpp/OCPPServiceUtils.ts', 'src/charging-station/ocpp/1.6/OCPP16ResponseService.ts', diff --git a/package.json b/package.json index 04b9ff56..dda9eb7f 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "lint": "cross-env TIMING=1 eslint --cache src tests ./*.js ./*.ts", "lint:fix": "cross-env TIMING=1 eslint --cache --fix src tests ./*.js ./*.ts", "format": "prettier --cache --write .; eslint --cache --fix src tests ./*.js ./*.ts", - "prettier": "prettier --cache --write .", "test": "glob -c \"c8 node --import tsx --test\" \"tests/**/*.test.ts\"", "test:debug": "glob -c \"node --import tsx --test --inspect\" \"tests/**/*.test.ts\"", "coverage": "c8 report --reporter=lcov", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 423b2bd5..69d7d69b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -155,7 +155,7 @@ importers: specifier: ^6.0.1 version: 6.0.1 semver: - specifier: ^7.5.3 + specifier: ^7.6.2 version: 7.6.2 ts-node: specifier: ^10.9.2 @@ -197,12 +197,6 @@ importers: '@types/node': specifier: ^20.14.10 version: 20.14.10 - '@typescript-eslint/eslint-plugin': - specifier: ^7.16.0 - version: 7.16.0(@typescript-eslint/parser@7.16.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3) - '@typescript-eslint/parser': - specifier: ^7.16.0 - version: 7.16.0(eslint@8.57.0)(typescript@5.5.3) '@vitejs/plugin-vue': specifier: ^5.0.5 version: 5.0.5(vite@5.3.3(@types/node@20.14.10))(vue@3.4.31(typescript@5.5.3)) @@ -257,6 +251,9 @@ importers: typescript: specifier: ~5.5.3 version: 5.5.3 + typescript-eslint: + specifier: ^7.16.0 + version: 7.16.0(eslint@8.57.0)(typescript@5.5.3) vite: specifier: ^5.3.3 version: 5.3.3(@types/node@20.14.10) @@ -5524,6 +5521,16 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + typescript-eslint@7.16.0: + resolution: {integrity: sha512-kaVRivQjOzuoCXU6+hLnjo3/baxyzWVO5GrnExkFzETRYJKVHYkrJglOu2OCm8Hi9RPDWX1PTNNTpU5KRV0+RA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + typescript-eslint@8.0.0-alpha.44: resolution: {integrity: sha512-4oRisGPvIJFnLqpfrpdcFjkFZg4/mhbE+0faGiomEFv9r5ziXETxuGY6VmwACPXHEakp2nDEqnp3ZdU0bsuiHQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -12072,6 +12079,17 @@ snapshots: typedarray@0.0.6: {} + typescript-eslint@7.16.0(eslint@8.57.0)(typescript@5.5.3): + dependencies: + '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/parser@7.16.0(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/parser': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + '@typescript-eslint/utils': 7.16.0(eslint@8.57.0)(typescript@5.5.3) + eslint: 8.57.0 + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - supports-color + typescript-eslint@8.0.0-alpha.44(eslint@9.7.0)(typescript@5.5.3): dependencies: '@typescript-eslint/eslint-plugin': 8.0.0-alpha.44(@typescript-eslint/parser@8.0.0-alpha.44(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0)(typescript@5.5.3) diff --git a/src/types/ocpp/Requests.ts b/src/types/ocpp/Requests.ts index b5d6f7f0..688cd7ff 100644 --- a/src/types/ocpp/Requests.ts +++ b/src/types/ocpp/Requests.ts @@ -60,7 +60,12 @@ export type ResponseCallback = (payload: JsonType, requestPayload: JsonType) => export type ErrorCallback = (ocppError: OCPPError, requestStatistic?: boolean) => void -export type CachedRequest = [ResponseCallback, ErrorCallback, RequestCommand, JsonType] +export type CachedRequest = [ + ResponseCallback, + ErrorCallback, + RequestCommand | IncomingRequestCommand, + JsonType +] export const MessageTrigger = { ...OCPP16MessageTrigger, diff --git a/ui/web/package.json b/ui/web/package.json index 4a6c9d3e..e6be5328 100644 --- a/ui/web/package.json +++ b/ui/web/package.json @@ -38,8 +38,6 @@ "@tsconfig/node20": "^20.1.4", "@types/jsdom": "^21.1.7", "@types/node": "^20.14.10", - "@typescript-eslint/eslint-plugin": "^7.16.0", - "@typescript-eslint/parser": "^7.16.0", "@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue-jsx": "^4.0.0", "@vitest/coverage-v8": "^2.0.3", @@ -58,6 +56,7 @@ "prettier": "^3.3.3", "rimraf": "^6.0.1", "typescript": "~5.5.3", + "typescript-eslint": "^7.16.0", "vite": "^5.3.3", "vitest": "^2.0.3" }