mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 21:01:33 +02:00
[web] change esm codemod to use vitest and general refactor GitOrigin-RevId: 7f8c699b160ee0b7ff991d6284cb126165694c4f
18 lines
397 B
Bash
Executable File
18 lines
397 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
script_dir=$(dirname "$0")
|
|
FILES_TO_FIX=$(eslint . --format compact --no-color \
|
|
| grep 'import/no-unresolved' \
|
|
| cut -d':' -f1 \
|
|
| sort -u)
|
|
|
|
if [ -z "$FILES_TO_FIX" ]; then
|
|
echo "No files with 'import/no-unresolved' errors found. Nothing to do!"
|
|
exit 0
|
|
fi
|
|
|
|
echo "$FILES_TO_FIX" | xargs jscodeshift --parser=babel -t "$script_dir/codemods/fixMissingJsImports.mjs"
|
|
|