fix: pre-commit eslint-docs sed strips docs/ from developer_docs path

The sed "s|docs/||g" flag removed ALL occurrences of "docs/" from
file paths, mangling "developer_docs/sidebars.js" into
"developer_sidebars.js". Use line-by-line processing with "^docs/"
to only strip the leading prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-23 16:45:24 -08:00
parent ff9acbf617
commit d449393df8

View File

@@ -83,7 +83,7 @@ repos:
files: ^superset-frontend/.*\.(js|jsx|ts|tsx)$
- id: eslint-docs
name: eslint (docs)
entry: bash -c 'cd docs && FILES=$(echo "$@" | sed "s|docs/||g") && yarn eslint --fix --quiet $FILES'
entry: bash -c 'cd docs && FILES=$(printf "%s\n" "$@" | sed "s|^docs/||" | tr "\n" " ") && yarn eslint --fix --quiet $FILES'
language: system
pass_filenames: true
files: ^docs/.*\.(js|jsx|ts|tsx)$