From 59a959f6b9e4a47821142bf3d2cd8c602cb33883 Mon Sep 17 00:00:00 2001 From: vringar Date: Tue, 27 Jun 2023 20:39:58 +0200 Subject: [PATCH 1/2] fix(pre-commit): also pass argument 0 to the lint Signed-off-by: vringar --- .pre-commit-config.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da7f7a9..9449597 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,9 +23,11 @@ repos: - id: eslint name: eslint language: system - files: 'Explorer/.*\.(js|jsx|ts|tsx)$' - entry: bash -c 'cd Explorer && npm run precommit-lint "$@"' - types: [file] + files: "^Explorer/" + entry: bash -c 'cd Explorer && npm run precommit-lint "$0" "$@"' + # Pass 1. argument explicitly + # $@ only captures arg 2-n + types_or: [javascript, jsx, ts, tsx, json] - id: golangci-lint name: golangci-lint language: system From 8b3ef230a0ad1ad515188ec44a55cc7dfe4cf634 Mon Sep 17 00:00:00 2001 From: vringar Date: Tue, 27 Jun 2023 21:16:03 +0200 Subject: [PATCH 2/2] fix(eslint): autofixed files Signed-off-by: vringar --- Explorer/.eslintrc.json | 2 +- Explorer/jest.config.mjs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Explorer/.eslintrc.json b/Explorer/.eslintrc.json index 5081ea0..18a1521 100755 --- a/Explorer/.eslintrc.json +++ b/Explorer/.eslintrc.json @@ -20,7 +20,7 @@ "@typescript-eslint/no-unused-vars": [ 2, { - "varsIgnorePattern" : "_" + "varsIgnorePattern": "_" } ] }, diff --git a/Explorer/jest.config.mjs b/Explorer/jest.config.mjs index a28d384..b80fa9f 100644 --- a/Explorer/jest.config.mjs +++ b/Explorer/jest.config.mjs @@ -1,9 +1,9 @@ -import nextJest from 'next/jest.js' +import nextJest from "next/jest.js"; const createJestConfig = nextJest({ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment - dir: './', -}) + dir: "./", +}); // Add any custom config to be passed to Jest /** @type {import('jest').Config} */ @@ -11,8 +11,8 @@ const config = { // Add more setup options before each test is run // setupFilesAfterEnv: ['/jest.setup.js'], - testEnvironment: 'jest-environment-jsdom', -} + testEnvironment: "jest-environment-jsdom", +}; // createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async -export default createJestConfig(config) +export default createJestConfig(config);