Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit for frontend #23

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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