Skip to content

Commit

Permalink
chore(share-data): add format and lint targets for js (#16529)
Browse files Browse the repository at this point in the history
Adds `format-js` and `lint-js` targets to shared-data's makefile
  • Loading branch information
sanni-t authored Oct 23, 2024
1 parent 9f28fab commit 7e3453d
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions shared-data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@ tests ?=
cov_opts ?= --coverage=true
test_opts ?=

# warning suppression variables for tests and linting
quiet ?= false

FORMAT_FILE_GLOB = "**/*.@(ts|tsx|js|json|md|yml)"

# Top level targets

.PHONY: all
all: clean dist

.PHONY: setup
setup: setup-py setup-js
setup: setup-py

.PHONY: dist
dist: dist-js dist-py
dist: dist-py

.PHONY: clean
clean: clean-py

.PHONY: format
format: format-js format-py

.PHONY: lint
lint: lint-js lint-py

# JavaScript targets

.PHONY: lib-js
Expand All @@ -34,6 +45,22 @@ lib-js:
build-ts:
yarn tsc --build --emitDeclarationOnly

.PHONY: format-js
format-js:
yarn prettier --ignore-path ../.eslintignore --write $(FORMAT_FILE_GLOB)

.PHONY: lint-js
lint-js: lint-js-eslint lint-js-prettier

.PHONY: lint-js-eslint
lint-js-eslint:
yarn eslint --ignore-path ../.eslintignore --quiet=$(quiet) "**/*.@(js|ts|tsx)"

.PHONY: lint-js-prettier
lint-js-prettier:
yarn prettier --ignore-path ../.eslintignore --check $(FORMAT_FILE_GLOB)


# Python targets

.PHONY: setup-py
Expand Down

0 comments on commit 7e3453d

Please sign in to comment.