build(scripts): add lint scripts to all, turbo lint tasks [skip ci]

This commit is contained in:
Elliot DeNolf
2024-08-28 21:55:34 -04:00
parent e375f6e727
commit 828f5d866d
36 changed files with 92 additions and 15 deletions

19
scripts/set_npm_script.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -ex
# Add/set an npm script on every package in packages directory
# Get all package.json files in packages directory, except eslint-* packages
package_json_files=$(find packages -name "package.json" \
-not -path "packages/eslint-*")
npm_script_name="lint"
npm_script_command="eslint ."
# Loop through each package.json file
for package_json_file in $package_json_files; do
# use jq to set a value inside of the package.json "scripts" object
jq ".scripts[\"$npm_script_name\"] = \"$npm_script_command\"" "$package_json_file" \
> tmp.json && mv tmp.json "$package_json_file"
done