Skip to content

Commit

Permalink
pre-commit for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed May 22, 2024
1 parent a29c59a commit 157cd11
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
5 changes: 2 additions & 3 deletions frontend_addon/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"__version_pnpm": "9.1.1",
"__version_pnpm_major": "9",
"__version_release_it": "^17.1.1",
"__version_pre_commit": "3.7.1",
"__gha_version_node": "20.x",
"__gha_version_checkout": "v4",
"__gha_version_setup_node": "v4",
Expand All @@ -39,9 +40,7 @@
"email": "Author E-mail"
},
"_copy_without_render": [],
"_extensions": [
"cookieplone.filters.latest_volto"
],
"_extensions": ["cookieplone.filters.latest_volto"],
"__cookieplone_repository_path": "",
"__cookieplone_template": ""
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
repos:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v9.2.0'
- repo: local
hooks:
- id: prettier
name: prettier
entry: pnpm exec prettier --write
language: system
files: '^packages/.*/src/.*/?.*.(js|jsx|ts|tsx)$'
types: [file]
- id: eslint
files: '^packages/.*/src/.*/*.(js,jsx,ts,tsx)$'
name: eslint
entry: pnpm exec eslint --max-warnings=0 --fix
language: system
files: '^packages/.*/src/.*/?.*.(js|jsx|ts|tsx)$'
types: [file]
- id: stylelint
name: stylelint
entry: pnpm exec stylelint --fix
language: system
files: '^packages/.*/src/.*/?.*.(css|scss|less)$'
types: [file]
- id: i18n
name: i18n
entry: make ci-i18n
language: system
files: '^packages/.*/src/.*/?.*.(js|jsx|ts|tsx)$'
types: [file]
5 changes: 5 additions & 0 deletions frontend_addon/{{ cookiecutter.__folder_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`

GIT_FOLDER=$(CURRENT_DIR)/.git
PRE_COMMIT=pipx run --spec 'pre-commit=={{cookiecutter.__version_pre_commit}}' pre-commit

PLONE_VERSION=6
DOCKER_IMAGE=plone/server-dev:${PLONE_VERSION}
DOCKER_IMAGE_ACCEPTANCE=plone/server-acceptance:${PLONE_VERSION}
Expand All @@ -33,6 +36,8 @@ help: ## Show this help

.PHONY: install
install: ## Installs the add-on in a development environment
@echo "$(GREEN)Install$(RESET)"
if [ -d $(GIT_FOLDER) ]; then $(PRE_COMMIT) install; else echo "$(RED) Not installing pre-commit$(RESET)";fi
pnpm dlx mrs-developer missdev --no-config --fetch-https
pnpm i

Expand Down

0 comments on commit 157cd11

Please sign in to comment.