mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Use correct typescript-formatter package
This commit is contained in:
parent
8972ba5dc8
commit
46e38c0356
@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Format TypeScript files with Biome
|
# Format TypeScript files with tsfmt
|
||||||
echo "Formatting TypeScript files..."
|
echo "Formatting TypeScript files..."
|
||||||
|
|
||||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
|
|
||||||
# Check if biome.json files match
|
# Check if tsfmt.json files match
|
||||||
if ! cmp -s ../spine-ts/biome.json ../tests/biome.json; then
|
if ! cmp -s ../spine-ts/tsfmt.json ../tests/tsfmt.json; then
|
||||||
echo -e "\033[1;31mERROR: spine-ts/biome.json and tests/biome.json differ!\033[0m"
|
echo -e "\033[1;31mERROR: spine-ts/tsfmt.json and tests/tsfmt.json differ!\033[0m"
|
||||||
echo -e "\033[1;31mPlease sync them to ensure consistent formatting.\033[0m"
|
echo -e "\033[1;31mPlease sync them to ensure consistent formatting.\033[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Format TypeScript files
|
# Format TypeScript files
|
||||||
cd ../spine-ts && npx biome format --write . && cd ../formatters
|
cd ../spine-ts && npm run format && cd ../formatters
|
||||||
cd ../tests && npx biome format --write --config-path ../spine-ts . && cd ../formatters
|
cd ../tests && npm run format -r && cd ../formatters
|
||||||
@ -32,7 +32,7 @@ fs.readdirSync('.').forEach(name => {
|
|||||||
|
|
||||||
if (allFiles.length > 0) {
|
if (allFiles.length > 0) {
|
||||||
console.log(`Formatting ${allFiles.length} TypeScript files...`);
|
console.log(`Formatting ${allFiles.length} TypeScript files...`);
|
||||||
execSync(`npx tsfmt -r ${allFiles.join(' ')}`, { stdio: 'inherit' });
|
execSync(`npx -y typescript-formatter -r ${allFiles.join(' ')}`, { stdio: 'inherit' });
|
||||||
} else {
|
} else {
|
||||||
console.log('No TypeScript files found to format.');
|
console.log('No TypeScript files found to format.');
|
||||||
}
|
}
|
||||||
@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compare": "tsx compare-with-reference-impl.ts",
|
"compare": "tsx compare-with-reference-impl.ts",
|
||||||
"format": "npx tsfmt -r ./**/*.ts",
|
"format": "npx -y typescript-formatter -r ./**/*.ts",
|
||||||
"lint": "npx biome lint ."
|
"lint": "npx biome lint ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user