@zimbra/eslint-config 2.0.0 → 2.1.1-main.96dc8a5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,144 @@
1
+ version: 2.1
2
+
3
+ ############################################################################
4
+
5
+ executors:
6
+ node-executor:
7
+ working_directory: ~/zm-eslint-config
8
+ docker:
9
+ - image: cimg/node:18.20
10
+ resource_class: small
11
+
12
+ env-context: &env-context
13
+ context:
14
+ - npm-js
15
+
16
+
17
+ ############################################################################
18
+ # Cache node_modules
19
+ restore-dependencies-cache: &restore-dependencies-cache
20
+ restore_cache:
21
+ keys:
22
+ - v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}
23
+ # fallback to using the cache from the same branch
24
+ - v1-dependencies-{{ .Branch }}-
25
+ # fallback to using the latest cache if no exact match is found
26
+ - v1-dependencies-
27
+
28
+ save-dependencies-cache: &save-dependencies-cache
29
+ save_cache:
30
+ paths:
31
+ - node_modules
32
+ key: v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }}
33
+
34
+ persist-workspace: &persist-workspace
35
+ persist_to_workspace:
36
+ root: ~/
37
+ paths:
38
+ - zm-eslint-config
39
+
40
+ attach-workspace: &attach-workspace
41
+ attach_workspace:
42
+ at: ~/
43
+
44
+ feature-branch: &feature-branch
45
+ filters:
46
+ branches:
47
+ ignore:
48
+ - /(custom_)?release\/.*/
49
+
50
+ ############################################################################
51
+ # COMMANDS
52
+ ############################################################################
53
+
54
+ commands:
55
+ remove-node-modules:
56
+ description: Remove node_modules before workspace persist
57
+
58
+ steps:
59
+ - run:
60
+ name: Remove node_modules before workspace persist
61
+ command: |
62
+ rm -rf node_modules
63
+
64
+ ############################################################################
65
+ # JOBS
66
+ ############################################################################
67
+
68
+ jobs:
69
+
70
+ lint:
71
+ executor: node-executor
72
+ steps:
73
+ - checkout
74
+
75
+ - *restore-dependencies-cache
76
+
77
+ - run:
78
+ name: Install dependencies
79
+ command: npm install
80
+
81
+ - *save-dependencies-cache
82
+
83
+ - run:
84
+ name: Lint
85
+ command: npm run lint
86
+
87
+ - remove-node-modules
88
+
89
+ - *persist-workspace
90
+
91
+
92
+ publish:
93
+ executor: node-executor
94
+ steps:
95
+ - *attach-workspace
96
+
97
+ - run:
98
+ name: Setup npm authentication
99
+ command: |
100
+ echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}" > ~/.npmrc
101
+
102
+ - run:
103
+ name: Set dynamic prerelease version (no git tag)
104
+ command: |
105
+ SAFE_BRANCH=$(echo "$CIRCLE_BRANCH" | sed 's/\//-/g')
106
+ SHORT_SHA=$(echo "$CIRCLE_SHA1" | cut -c1-7)
107
+
108
+ npm version prerelease \
109
+ --preid="${SAFE_BRANCH}.${SHORT_SHA}" \
110
+ --no-git-tag-version
111
+
112
+ - run:
113
+ name: Publish to npm
114
+ command: |
115
+ SAFE_BRANCH=$(echo "$CIRCLE_BRANCH" | sed 's/\//-/g')
116
+ if [ "$SAFE_BRANCH" = "main" ]; then
117
+ npm publish --access public --tag beta
118
+ else
119
+ npm publish --access public --tag next
120
+ fi
121
+
122
+ ############################################################################
123
+ # WORKFLOWS
124
+ ############################################################################
125
+
126
+ workflows:
127
+ version: 2
128
+
129
+ lint-and-publish:
130
+ jobs:
131
+ - lint:
132
+ <<: *feature-branch
133
+
134
+ - publish-approval:
135
+ <<: *feature-branch
136
+ type: approval
137
+ requires:
138
+ - lint
139
+
140
+ - publish:
141
+ <<: *feature-branch
142
+ <<: *env-context
143
+ requires:
144
+ - publish-approval
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimbra/eslint-config",
3
- "version": "2.0.0",
3
+ "version": "2.1.1-main.96dc8a5.0",
4
4
  "type": "module",
5
5
  "description": "ESLint configuration for Zimbra javascript projects.",
6
6
  "main": "src/index.js",
@@ -11,6 +11,7 @@
11
11
  "scripts": {
12
12
  "lint": "eslint src --config eslint.config.mjs",
13
13
  "lint:fix": "npm run lint -- --fix",
14
+ "prepublishOnly": "if [ \"$CI\" != \"true\" ]; then npm run lint && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags; fi",
14
15
  "prepare": "husky || true"
15
16
  },
16
17
  "engines": {
@@ -32,6 +33,7 @@
32
33
  "eslint-plugin-testcafe": "^0.2.1",
33
34
  "globals": "^17.3.0",
34
35
  "prettier": "^3.6.2",
36
+ "prettier-eslint": "^16.4.2",
35
37
  "typescript": "^5.9.3"
36
38
  },
37
39
  "peerDependencies": {