Skip to content

Commit f5c1edd

Browse files
author
Konrad Michalik
authored
Merge pull request #14 from move-elevator/frontend-linter
feat: add linting jobs for JavaScript and CSS/SCSS in CI configuration
2 parents 1f70295 + 67d0da1 commit f5c1edd

File tree

4 files changed

+52
-4
lines changed

4 files changed

+52
-4
lines changed

.gitlab-ci.yml.dist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ include:
77
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/build/build-node.yaml'
88
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-composer-lint.yaml'
99
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-editorconfig.yaml'
10+
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-js-lint.yaml'
1011
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-php.yaml'
1112
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-php-cs-fixer.yaml'
1213
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-php-stan.yaml'
1314
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-php-rector.yaml'
15+
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-style-lint.yaml'
1416
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-typoscript-lint.yaml'
1517
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-yaml-lint.yaml'
1618
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/analyze/analyze-xml-lint.yaml'
@@ -24,8 +26,8 @@ include:
2426
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/sync/sync-feature-scheduled.yaml'
2527
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/test/test-feature-codeception.yaml'
2628
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/test/test-prod-codeception.yaml'
27-
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/test/cache-feature-warmup.yaml'
28-
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/test/cache-prod-warmup.yaml'
29+
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/cache/cache-feature-warmup.yaml'
30+
- 'https://raw.githubusercontent.com/move-elevator/gitlab-ci-templates/main/cache/cache-prod-warmup.yaml'
2931

3032
#-----------------------------------------------------------------------------------------------------------------------
3133
# CONFIGURATION (overrides)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ Analyze code quality and static analysis.
5050
Includes:
5151
- `analyze/analyze-composer-lint.yaml`
5252
- `analyze/analyze-editorconfig.yaml`
53+
- `analyze/analyze-js-lint.yaml`
5354
- `analyze/analyze-php-cs-fixer.yaml`
5455
- `analyze/analyze-php-rector.yaml`
5556
- `analyze/analyze-php-stan.yaml`
57+
- `analyze/analyze-style-lint.yaml`
5658
- `analyze/analyze-typoscript-lint.yaml`
5759
- `analyze/analyze-xml-lint.yaml`
5860
- `analyze/analyze-yaml-lint.yaml`
@@ -106,8 +108,8 @@ Includes:
106108
Warm up the cache after deployment using [EXT:typo3-warming](https://github.com/eliashaeussler/typo3-warming).
107109

108110
Includes:
109-
- `test/cache-feature-warmup.yaml`
110-
- `test/cache-prod-warmup.yaml`
111+
- `cache/cache-feature-warmup.yaml`
112+
- `cache/cache-prod-warmup.yaml`
111113

112114
## ⭐ License
113115

analyze/analyze-js-lint.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Purpose:
2+
# Analyze job for linting all js/ts files
3+
#
4+
# Dependency:
5+
# Npm script "lint:js"
6+
#
7+
analyze:js:lint:
8+
image:
9+
name: ${DEFAULT_IMAGE_BUILD_NODE}
10+
stage: analyze
11+
needs:
12+
- build:node
13+
script:
14+
- npm run lint:js
15+
rules:
16+
- if: $CI_PIPELINE_SOURCE == "web"
17+
when: always
18+
- if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
19+
when: never
20+
- if: $CI_COMMIT_TAG == null
21+
changes:
22+
- "**/*.{js,jsx,mjs,cjs,ts,tsx}"

analyze/analyze-style-lint.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Purpose:
2+
# Analyze job for linting all css/scss files
3+
#
4+
# Dependency:
5+
# Npm script "lint:style"
6+
#
7+
analyze:style:lint:
8+
image:
9+
name: ${DEFAULT_IMAGE_BUILD_NODE}
10+
stage: analyze
11+
needs:
12+
- build:node
13+
script:
14+
- npm run lint:style
15+
rules:
16+
- if: $CI_PIPELINE_SOURCE == "web"
17+
when: always
18+
- if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "merge_request_event"
19+
when: never
20+
- if: $CI_COMMIT_TAG == null
21+
changes:
22+
- "**/*.{css,scss,sass}"

0 commit comments

Comments
 (0)