feat(ci): fail CI if there are non-typescript UI compoments

This commit is contained in:
Łukasz Mierzwa
2020-07-16 09:53:00 +01:00
committed by Łukasz Mierzwa
parent 4a16661558
commit 3b68860f38
2 changed files with 10 additions and 0 deletions

View File

@@ -86,6 +86,11 @@ jobs:
after_success:
- travis_retry curl -s --connect-timeout 30 --fail https://codecov.io/bash | bash -s -- -F ui
- stage: Lint
name: Check for non-typescript UI components
if: (repo = prymitive/karma AND type != pull_request) OR (fork = true AND type = pull_request)
script: make -C ui lint-typescript
- stage: Lint
name: Lint git commit
if: (repo = prymitive/karma AND type != pull_request) OR (fork = true AND type = pull_request)

View File

@@ -41,6 +41,11 @@ lint-docs: node_modules/markdownlint-cli/markdownlint.js
lint-deps: node_modules/depcheck/bin/depcheck.js
node_modules/depcheck/bin/depcheck.js $(CURDIR)
.PHONY: lint-typescript
lint-typescript:
@$(eval JSFILES := $(shell find $(CURDIR)/src/Components -name \*.js -not -name \*.test.js -not -name \*.stories.js))
@if [ "$(JSFILES)" != "" ]; then echo "$(JSFILES)" | tr " " "\n"; exit 1 ; fi
.PHONY: format
format: node_modules/prettier/bin-prettier.js
node_modules/prettier/bin-prettier.js --write 'src/**/*.js' 'src/**/*.ts' 'src/**/*.tsx'