[Lint-staged] big speed improvement

This commit is contained in:
joonas-a
2026-07-21 13:30:16 +03:00
parent d5e7d5c253
commit 19a25f8715
+2 -5
View File
@@ -5,18 +5,15 @@ const dockerCmdBase = `docker run --rm --volume ${cwd}:/oodikone --workdir /oodi
const relativeFilePaths = files => [...files.map(file => relative(cwd, file))].join(' ')
export default {
// INFO: oxlint --type-check is equivalent to running tsc --noEmit
'{services,updater}/**/*.{js,jsx,ts,tsx}': files =>
`oxlint --fix --no-error-on-unmatched-pattern --quiet ${files.join(' ')}`,
`oxlint --fix --type-aware --type-check --no-error-on-unmatched-pattern --quiet ${files.join(' ')}`,
'*.{js,jsx,ts,tsx,json,md,yml,yaml,html,css}': files =>
`oxfmt --no-error-on-unmatched-pattern --quiet ${files.join(' ')} `,
'*.css': files => `stylelint --fix ${files.join(' ')}`,
'services/backend/**/*.{ts,tsx}': () => 'npx tsc --noEmit --project services/backend/tsconfig.json',
'services/frontend/**/*.{ts,tsx}': () => 'npx tsc --noEmit --project services/frontend/tsconfig.json',
'services/shared/**/*.{ts,tsx}': () => 'npx tsc --noEmit --project services/shared/tsconfig.json',
Dockerfile: files =>
`${dockerCmdBase} hadolint/hadolint:v2.14.0 hadolint --ignore DL3006 ${relativeFilePaths(files)}`,
'*.sh': files => `${dockerCmdBase} koalaman/shellcheck:v0.11.0 ${relativeFilePaths(files)} -x`,