Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pre-commit): also pass argument 0 to the lint #187

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Explorer/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@typescript-eslint/no-unused-vars": [
2,
{
"varsIgnorePattern" : "_"
"varsIgnorePattern": "_"
}
]
},
Expand Down
12 changes: 6 additions & 6 deletions Explorer/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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} */
const config = {
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/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);