diff --git a/.travis.yml b/.travis.yml index d8101e571..a961ba23c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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) diff --git a/ui/Makefile b/ui/Makefile index 61f0431c7..b98c62c60 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -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'