Skip to content

Commit

Permalink
chore: lint-staged (#3401)
Browse files Browse the repository at this point in the history
This adds `lint-staged` to all packages and the root to lint staged
changes depending on the package (environment).

1. root: lint lock-file only
2. kuma-gui: lint styles and scripts only
3. config: lint scripts only

---

Apart from lint-staged all the shareable make targets and recipes have
been moved to our config/tooling package.

---------

Signed-off-by: schogges <[email protected]>
  • Loading branch information
schogges authored Jan 15, 2025
1 parent 6553bbb commit 20ae344
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"package-lock.json": "make lint/lock"
}
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
SHELL := /usr/bin/env bash
MK := ./packages/kuma-gui/mk
MK := ./packages/config/src/mk

## make help: if you're aren't sure use `make help`
.DEFAULT_GOAL := help

include $(MK)/install.mk
include $(MK)/check.mk
include $(MK)/help.mk

.PHONY: clean
clean: .clean ## Dev: Remove all `node_modules` recursively

.PHONY: install
install: .install ## Dev: Install all dependencies

.PHONY: help
help: .help ## Display this help screen
2 changes: 1 addition & 1 deletion packages/config/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{cjs,js,ts}": "make lint"
"*.{cjs,js,ts,vue}": "make lint"
}
9 changes: 8 additions & 1 deletion packages/config/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
MK := ../kuma-gui/mk
MK := ./src/mk

## make help: if you're aren't sure use `make help`
.DEFAULT_GOAL := help

include $(MK)/check.mk
include $(MK)/help.mk

.PHONY: help
help: .help ## Display this help screen

.PHONY: lint
lint: .lint/script ## Dev: Run all lint script checks (js,ts)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions packages/kuma-gui/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"*.{js,ts,vue}": "make -C ./packages/kuma-gui -j2 lint/script",
"*.{css,scss,vue}": "make -C ./packages/kuma-gui lint/css",
"package-lock.json": "make -C ./packages/kuma-gui lint/lock"
"*.{cjs,js,ts,vue}": "make -j2 .lint/script",
"*.{css,scss,vue}": "make lint/css"
}
5 changes: 1 addition & 4 deletions packages/kuma-gui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It should only be used for adding "non-dot" aliases and documentation

SHELL := /usr/bin/env bash
MK := ./mk
MK := ../config/src/mk
NODE_VERSION:=v$(shell cat ../../.nvmrc)
NPM_WORKFLOW_CONFIG_PATH ?= $(shell readlink -f ../config)

Expand All @@ -28,9 +28,6 @@ install/sync: .install/sync
.PHONY: help
help: .help ## Display this help screen

.PHONY: clean
clean: .clean ## Dev: Delete all node_modules directories

.PHONY: install
install: .install ## Dev: install all dependencies (runs before `make run`)

Expand Down

0 comments on commit 20ae344

Please sign in to comment.