mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
feat: Add lint pass to prevent future issues
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d1159e3c32
commit
f2f23109ba
3
.github/workflows/linter.yml
vendored
3
.github/workflows/linter.yml
vendored
@ -27,3 +27,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Verify Publish Configurations
|
||||||
|
run: ./scripts/lint-publish-configs.sh
|
||||||
|
|||||||
23
scripts/lint-publish-configs.sh
Executable file
23
scripts/lint-publish-configs.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
PACKAGE_JSON_PATHS=$(find packages/* -type f -name package.json -not -path "*/node_modules/*")
|
||||||
|
exitCode=0
|
||||||
|
|
||||||
|
while IFS= read -r PACKAGE_JSON_PATH; do
|
||||||
|
PACKAGE_NAME=$(<"${PACKAGE_JSON_PATH}" jq .name)
|
||||||
|
PACKAGE_IS_PRIVATE=$(<"${PACKAGE_JSON_PATH}" jq .private)
|
||||||
|
|
||||||
|
if [[ "${PACKAGE_IS_PRIVATE}" == "true" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
PACKAGE_HAS_PUBLISH_CONFIG=$(<"${PACKAGE_JSON_PATH}" jq '.publishConfig != null')
|
||||||
|
|
||||||
|
if [[ "${PACKAGE_HAS_PUBLISH_CONFIG}" == "false" ]]; then
|
||||||
|
echo "${PACKAGE_NAME} is missing publish config"
|
||||||
|
exitCode=1
|
||||||
|
fi
|
||||||
|
done <<< "${PACKAGE_JSON_PATHS}"
|
||||||
|
|
||||||
|
exit "${exitCode}"
|
||||||
Loading…
Reference in New Issue
Block a user