@oncehub/eslint-config 2.0.0 → 2.1.1-beta.2

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,11 @@
1
+ apiVersion: kpt.dev/v1alpha1
2
+ kind: Kptfile
3
+ metadata:
4
+ name: jenkins-x
5
+ upstream:
6
+ type: git
7
+ git:
8
+ commit: 4b44dcda8284ebcecf7eed34c00f23b54e7a9d27
9
+ repo: https://github.com/scheduleonce/jx3-pipeline-catalog
10
+ directory: /packs/eslint-config-oncehub/.lighthouse/jenkins-x
11
+ ref: master
@@ -0,0 +1,278 @@
1
+ apiVersion: tekton.dev/v1beta1
2
+ kind: PipelineRun
3
+ metadata:
4
+ creationTimestamp: null
5
+ labels:
6
+ branch: master
7
+ build: "1"
8
+ jenkins.io/pipelineType: build
9
+ owner: jenkins-x-quickstarts
10
+ repository: eslint-config-oncehub
11
+ name: eslint-pr
12
+ spec:
13
+ pipelineSpec:
14
+ params:
15
+ - description: the unique build number
16
+ name: BUILD_ID
17
+ type: string
18
+ - description: the name of the job which is the trigger context name
19
+ name: JOB_NAME
20
+ type: string
21
+ - description: the specification of the job
22
+ name: JOB_SPEC
23
+ type: string
24
+ - description: 'the kind of job: postsubmit or presubmit'
25
+ name: JOB_TYPE
26
+ type: string
27
+ - default: master
28
+ description: the base git reference of the pull request
29
+ name: PULL_BASE_REF
30
+ type: string
31
+ - description: the git sha of the base of the pull request
32
+ name: PULL_BASE_SHA
33
+ type: string
34
+ - default: ""
35
+ description: git pull request number
36
+ name: PULL_NUMBER
37
+ type: string
38
+ - default: ""
39
+ description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
40
+ name: PULL_PULL_REF
41
+ type: string
42
+ - default: master
43
+ description: git revision to checkout (branch, tag, sha, ref…)
44
+ name: PULL_PULL_SHA
45
+ type: string
46
+ - description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
47
+ name: PULL_REFS
48
+ type: string
49
+ - description: git repository name
50
+ name: REPO_NAME
51
+ type: string
52
+ - description: git repository owner (user or organisation)
53
+ name: REPO_OWNER
54
+ type: string
55
+ - description: git url to clone
56
+ name: REPO_URL
57
+ type: string
58
+ tasks:
59
+ - name: eslint-pr
60
+ params:
61
+ - name: BUILD_ID
62
+ value: $(params.BUILD_ID)
63
+ - name: JOB_NAME
64
+ value: $(params.JOB_NAME)
65
+ - name: JOB_SPEC
66
+ value: $(params.JOB_SPEC)
67
+ - name: JOB_TYPE
68
+ value: $(params.JOB_TYPE)
69
+ - name: PULL_BASE_REF
70
+ value: $(params.PULL_BASE_REF)
71
+ - name: PULL_BASE_SHA
72
+ value: $(params.PULL_BASE_SHA)
73
+ - name: PULL_NUMBER
74
+ value: $(params.PULL_NUMBER)
75
+ - name: PULL_PULL_REF
76
+ value: $(params.PULL_PULL_REF)
77
+ - name: PULL_PULL_SHA
78
+ value: $(params.PULL_PULL_SHA)
79
+ - name: PULL_REFS
80
+ value: $(params.PULL_REFS)
81
+ - name: REPO_NAME
82
+ value: $(params.REPO_NAME)
83
+ - name: REPO_OWNER
84
+ value: $(params.REPO_OWNER)
85
+ - name: REPO_URL
86
+ value: $(params.REPO_URL)
87
+ resources: {}
88
+ taskSpec:
89
+ params:
90
+ - description: git url to clone
91
+ name: REPO_URL
92
+ type: string
93
+ - default: master
94
+ description: git revision to checkout (branch, tag, sha, ref…)
95
+ name: PULL_PULL_SHA
96
+ type: string
97
+ - default: source
98
+ description: subdirectory inside of /workspace to clone the git repo
99
+ name: subdirectory
100
+ type: string
101
+ - description: the unique build number
102
+ name: BUILD_ID
103
+ type: string
104
+ - description: the name of the job which is the trigger context name
105
+ name: JOB_NAME
106
+ type: string
107
+ - description: the specification of the job
108
+ name: JOB_SPEC
109
+ type: string
110
+ - description: 'the kind of job: postsubmit or presubmit'
111
+ name: JOB_TYPE
112
+ type: string
113
+ - default: master
114
+ description: the base git reference of the pull request
115
+ name: PULL_BASE_REF
116
+ type: string
117
+ - description: the git sha of the base of the pull request
118
+ name: PULL_BASE_SHA
119
+ type: string
120
+ - default: ""
121
+ description: git pull request number
122
+ name: PULL_NUMBER
123
+ type: string
124
+ - default: ""
125
+ description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
126
+ name: PULL_PULL_REF
127
+ type: string
128
+ - description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
129
+ name: PULL_REFS
130
+ type: string
131
+ - description: git repository name
132
+ name: REPO_NAME
133
+ type: string
134
+ - description: git repository owner (user or organisation)
135
+ name: REPO_OWNER
136
+ type: string
137
+ stepTemplate:
138
+ env:
139
+ - name: BUILD_ID
140
+ value: $(params.BUILD_ID)
141
+ - name: JOB_NAME
142
+ value: $(params.JOB_NAME)
143
+ - name: JOB_SPEC
144
+ value: $(params.JOB_SPEC)
145
+ - name: JOB_TYPE
146
+ value: $(params.JOB_TYPE)
147
+ - name: PULL_BASE_REF
148
+ value: $(params.PULL_BASE_REF)
149
+ - name: PULL_BASE_SHA
150
+ value: $(params.PULL_BASE_SHA)
151
+ - name: PULL_NUMBER
152
+ value: $(params.PULL_NUMBER)
153
+ - name: PULL_PULL_REF
154
+ value: $(params.PULL_PULL_REF)
155
+ - name: PULL_PULL_SHA
156
+ value: $(params.PULL_PULL_SHA)
157
+ - name: PULL_REFS
158
+ value: $(params.PULL_REFS)
159
+ - name: REPO_NAME
160
+ value: $(params.REPO_NAME)
161
+ - name: REPO_OWNER
162
+ value: $(params.REPO_OWNER)
163
+ - name: REPO_URL
164
+ value: $(params.REPO_URL)
165
+ - name: DOCKER_REGISTRY
166
+ valueFrom:
167
+ configMapKeyRef:
168
+ name: jenkins-x-docker-registry
169
+ key: docker.registry
170
+ - name: DOCKER_REGISTRY_ORG
171
+ value: "kubernetes"
172
+ name: ""
173
+ resources:
174
+ requests:
175
+ cpu: 400m
176
+ memory: 512Mi
177
+ volumeMounts:
178
+ - mountPath: /home/jenkins
179
+ name: workspace-volume
180
+ - mountPath: /etc/podinfo
181
+ name: podinfo
182
+ readOnly: true
183
+ - mountPath: /merge-disabled
184
+ name: merge-disabled
185
+ readOnly: true
186
+ workingDir: /workspace/source
187
+ steps:
188
+ - script: |
189
+ #!/usr/bin/env bash
190
+ RED='\033[0;31m'
191
+ NC='\033[0m' # No Color
192
+ mergeDisabled=$(cat "/merge-disabled/MERGE_DISABLED")
193
+ if [[ $(params.PULL_BASE_REF) == "qa" && $mergeDisabled == "true" ]]; then
194
+ echo -e "\n ${RED}Merge is temporarly disabled for $(params.PULL_BASE_REF) branch...Please close/reopen the PR's once merge is enabled...${NC}"
195
+ exit 1;
196
+ fi
197
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
198
+ name: check-merge-disabled
199
+ - args:
200
+ - -c
201
+ - 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-so-integrations}; git config --global --add user.email ${GIT_AUTHOR_EMAIL:-so-integrations@oncehub.com}; git config --global credential.helper store; git clone $(params.REPO_URL) $(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory);'
202
+ command:
203
+ - /bin/sh
204
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
205
+ name: git-clone
206
+ resources: {}
207
+ workingDir: /workspace
208
+ - args:
209
+ - '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
210
+ command:
211
+ - /bin/sh
212
+ - -c
213
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
214
+ name: setup-builder-home
215
+ resources: {}
216
+ - args:
217
+ - step
218
+ - git
219
+ - merge
220
+ - --verbose
221
+ - --baseSHA
222
+ - $(params.PULL_BASE_SHA)
223
+ - --sha
224
+ - $(params.PULL_PULL_SHA)
225
+ - --baseBranch
226
+ - $(params.PULL_BASE_REF)
227
+ command:
228
+ - jx
229
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
230
+ name: git-merge
231
+ resources: {}
232
+ - args:
233
+ - -c
234
+ - |
235
+ /bin/bash <<'EOF'
236
+ # Script to evaluate image tag.
237
+ branchName=$PULL_BASE_REF
238
+ echo "eval tag script for $branchName branch..."
239
+ teamBranchReg="team\/.*"
240
+ storyBranchReg=".*\/story\/.*"
241
+ if [[ $branchName =~ $teamBranchReg ]]; then
242
+ tag=$(echo $branchName | sed 's/team\//''/g' )
243
+ elif [[ $branchName =~ $storyBranchReg ]]; then
244
+ tag=$(echo $branchName | sed 's/\/.*/''/g' )
245
+ elif [[ $branchName == "master" ]]; then
246
+ tag="prod"
247
+ elif [[ $branchName == "qa" || $branchName == "staging-app2" ]]; then
248
+ tag=$branchName
249
+ else
250
+ tag="${branchName//\//'-'}"
251
+ fi
252
+ echo $tag > VERSION
253
+ EOF
254
+ command:
255
+ - /bin/sh
256
+ image: ghcr.io/jenkins-x/builder-go
257
+ name: pr-version
258
+ resources: {}
259
+ volumes:
260
+ - emptyDir: {}
261
+ name: workspace-volume
262
+ - downwardAPI:
263
+ items:
264
+ - fieldRef:
265
+ fieldPath: metadata.labels
266
+ path: labels
267
+ name: podinfo
268
+ - name: merge-disabled
269
+ secret:
270
+ secretName: merge-disabled
271
+ podTemplate:
272
+ ImagePullSecrets:
273
+ - name: tekton-container-registry-auth
274
+ hostNetwork: false
275
+ schedulerName: ""
276
+ serviceAccountName: tekton-bot
277
+ timeout: 240h0m0s
278
+ status: {}
@@ -0,0 +1,269 @@
1
+ apiVersion: tekton.dev/v1beta1
2
+ kind: PipelineRun
3
+ metadata:
4
+ creationTimestamp: null
5
+ labels:
6
+ branch: master
7
+ build: "1"
8
+ jenkins.io/pipelineType: build
9
+ owner: jenkins-x-quickstarts
10
+ repository: eslint-config-oncehub
11
+ name: eslint
12
+ spec:
13
+ pipelineSpec:
14
+ params:
15
+ - description: the unique build number
16
+ name: BUILD_ID
17
+ type: string
18
+ - description: the name of the job which is the trigger context name
19
+ name: JOB_NAME
20
+ type: string
21
+ - description: the specification of the job
22
+ name: JOB_SPEC
23
+ type: string
24
+ - description: 'the kind of job: postsubmit or presubmit'
25
+ name: JOB_TYPE
26
+ type: string
27
+ - default: master
28
+ description: the base git reference of the pull request
29
+ name: PULL_BASE_REF
30
+ type: string
31
+ - description: the git sha of the base of the pull request
32
+ name: PULL_BASE_SHA
33
+ type: string
34
+ - default: ""
35
+ description: git pull request number
36
+ name: PULL_NUMBER
37
+ type: string
38
+ - default: ""
39
+ description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
40
+ name: PULL_PULL_REF
41
+ type: string
42
+ - default: master
43
+ description: git revision to checkout (branch, tag, sha, ref…)
44
+ name: PULL_PULL_SHA
45
+ type: string
46
+ - description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
47
+ name: PULL_REFS
48
+ type: string
49
+ - description: git repository name
50
+ name: REPO_NAME
51
+ type: string
52
+ - description: git repository owner (user or organisation)
53
+ name: REPO_OWNER
54
+ type: string
55
+ - description: git url to clone
56
+ name: REPO_URL
57
+ type: string
58
+ tasks:
59
+ - name: release
60
+ params:
61
+ - name: BUILD_ID
62
+ value: $(params.BUILD_ID)
63
+ - name: JOB_NAME
64
+ value: $(params.JOB_NAME)
65
+ - name: JOB_SPEC
66
+ value: $(params.JOB_SPEC)
67
+ - name: JOB_TYPE
68
+ value: $(params.JOB_TYPE)
69
+ - name: PULL_BASE_REF
70
+ value: $(params.PULL_BASE_REF)
71
+ - name: PULL_BASE_SHA
72
+ value: $(params.PULL_BASE_SHA)
73
+ - name: PULL_NUMBER
74
+ value: $(params.PULL_NUMBER)
75
+ - name: PULL_PULL_REF
76
+ value: $(params.PULL_PULL_REF)
77
+ - name: PULL_PULL_SHA
78
+ value: $(params.PULL_PULL_SHA)
79
+ - name: PULL_REFS
80
+ value: $(params.PULL_REFS)
81
+ - name: REPO_NAME
82
+ value: $(params.REPO_NAME)
83
+ - name: REPO_OWNER
84
+ value: $(params.REPO_OWNER)
85
+ - name: REPO_URL
86
+ value: $(params.REPO_URL)
87
+ resources: {}
88
+ taskSpec:
89
+ params:
90
+ - description: git url to clone
91
+ name: REPO_URL
92
+ type: string
93
+ - default: master
94
+ description: git revision to checkout (branch, tag, sha, ref…)
95
+ name: PULL_PULL_SHA
96
+ type: string
97
+ - default: source
98
+ description: subdirectory inside of /workspace to clone the git repo
99
+ name: subdirectory
100
+ type: string
101
+ - description: the unique build number
102
+ name: BUILD_ID
103
+ type: string
104
+ - description: the name of the job which is the trigger context name
105
+ name: JOB_NAME
106
+ type: string
107
+ - description: the specification of the job
108
+ name: JOB_SPEC
109
+ type: string
110
+ - description: 'the kind of job: postsubmit or presubmit'
111
+ name: JOB_TYPE
112
+ type: string
113
+ - default: master
114
+ description: the base git reference of the pull request
115
+ name: PULL_BASE_REF
116
+ type: string
117
+ - description: the git sha of the base of the pull request
118
+ name: PULL_BASE_SHA
119
+ type: string
120
+ - default: ""
121
+ description: git pull request number
122
+ name: PULL_NUMBER
123
+ type: string
124
+ - default: ""
125
+ description: git pull request ref in the form 'refs/pull/$PULL_NUMBER/head'
126
+ name: PULL_PULL_REF
127
+ type: string
128
+ - description: git pull reference strings of base and latest in the form 'master:$PULL_BASE_SHA,$PULL_NUMBER:$PULL_PULL_SHA:refs/pull/$PULL_NUMBER/head'
129
+ name: PULL_REFS
130
+ type: string
131
+ - description: git repository name
132
+ name: REPO_NAME
133
+ type: string
134
+ - description: git repository owner (user or organisation)
135
+ name: REPO_OWNER
136
+ type: string
137
+ stepTemplate:
138
+ env:
139
+ - name: BUILD_ID
140
+ value: $(params.BUILD_ID)
141
+ - name: JOB_NAME
142
+ value: $(params.JOB_NAME)
143
+ - name: JOB_SPEC
144
+ value: $(params.JOB_SPEC)
145
+ - name: JOB_TYPE
146
+ value: $(params.JOB_TYPE)
147
+ - name: PULL_BASE_REF
148
+ value: $(params.PULL_BASE_REF)
149
+ - name: PULL_BASE_SHA
150
+ value: $(params.PULL_BASE_SHA)
151
+ - name: PULL_NUMBER
152
+ value: $(params.PULL_NUMBER)
153
+ - name: PULL_PULL_REF
154
+ value: $(params.PULL_PULL_REF)
155
+ - name: PULL_PULL_SHA
156
+ value: $(params.PULL_PULL_SHA)
157
+ - name: PULL_REFS
158
+ value: $(params.PULL_REFS)
159
+ - name: REPO_NAME
160
+ value: $(params.REPO_NAME)
161
+ - name: REPO_OWNER
162
+ value: $(params.REPO_OWNER)
163
+ - name: REPO_URL
164
+ value: $(params.REPO_URL)
165
+ - name: DOCKER_REGISTRY
166
+ valueFrom:
167
+ configMapKeyRef:
168
+ name: jenkins-x-docker-registry
169
+ key: docker.registry
170
+ - name: DOCKER_REGISTRY_ORG
171
+ value: "kubernetes"
172
+ name: ""
173
+ resources:
174
+ requests:
175
+ cpu: 400m
176
+ memory: 512Mi
177
+ volumeMounts:
178
+ - mountPath: /home/jenkins
179
+ name: workspace-volume
180
+ - mountPath: /etc/podinfo
181
+ name: podinfo
182
+ readOnly: true
183
+ - mountPath: /etc/npm-cred
184
+ name: npm-cred
185
+ readOnly: true
186
+ workingDir: /workspace/source
187
+ steps:
188
+ - script: |
189
+ #!/bin/bash
190
+ # Check for already running release pipeline and wait for them to get finished(if any) before continuing.
191
+ ENV=$(echo $PULL_BASE_REF | cut -d '/' -f 2)
192
+ echo "Checking already running release pipelines for ${REPO_NAME}'s service on $ENV...";
193
+ CURRENT_BUILD_NO=$(jx get build pod | grep $HOSTNAME | awk '{print $4}');
194
+ checkAlreadyRunningPipelines() {
195
+ ALREADY_RUNNING_PIPELINES_COUNT=$(jx get build pods | awk -v REPO_NAME="$REPO_NAME" -v JOB_NAME="$JOB_NAME" -v ENV="$ENV" -v CURRENT_BUILD_NO="$CURRENT_BUILD_NO" '{if($2==REPO_NAME && $5==JOB_NAME && $3==ENV && $4<CURRENT_BUILD_NO && $7~"Pending|Running") {print $0}}' | wc -l);
196
+ if [[ $ALREADY_RUNNING_PIPELINES_COUNT != 0 ]]; then
197
+ echo "Waiting for already running ${REPO_NAME}'s release pipelines to get finished before continuing to avoid race conditon on $ENV..."
198
+ sleep 1m;
199
+ checkAlreadyRunningPipelines
200
+ fi
201
+ }
202
+ checkAlreadyRunningPipelines
203
+ image: ghcr.io/jenkins-x/jx-cli:3.1.299
204
+ name: handle-race-condition
205
+ resources: {}
206
+ - args:
207
+ - -c
208
+ - 'mkdir -p $HOME; git config --global --add user.name ${GIT_AUTHOR_NAME:-so-integrations};
209
+ git config --global --add user.email ${GIT_AUTHOR_EMAIL:-so-integrations@oncehub.com};
210
+ git config --global credential.helper store; git clone $(params.REPO_URL)
211
+ $(params.subdirectory); echo cloned url: $(params.REPO_URL) to dir: $(params.subdirectory);'
212
+ command:
213
+ - /bin/sh
214
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
215
+ name: git-clone
216
+ resources: {}
217
+ workingDir: /workspace
218
+ - args:
219
+ - step
220
+ - git
221
+ - merge
222
+ - --verbose
223
+ - --baseSHA
224
+ - $(params.PULL_BASE_SHA)
225
+ - --sha
226
+ - $(params.PULL_BASE_REF)
227
+ - --baseBranch
228
+ - $(params.PULL_BASE_REF)
229
+ command:
230
+ - jx
231
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
232
+ name: git-merge
233
+ resources: {}
234
+ - args:
235
+ - '[ -d /builder/home ] || mkdir -p /builder && ln -s /tekton/home /builder/home'
236
+ command:
237
+ - /bin/sh
238
+ - -c
239
+ image: ghcr.io/jenkins-x/builder-jx:2.1.155-779
240
+ name: setup-builder-home
241
+ resources: {}
242
+ - args:
243
+ - sh deploy.sh
244
+ command:
245
+ - /bin/sh
246
+ - -c
247
+ image: dockeronce.azurecr.io/cloudbees/nodejs:sonf-v16-latest
248
+ name: package-build-publish
249
+ resources: {}
250
+ volumes:
251
+ - emptyDir: {}
252
+ name: workspace-volume
253
+ - downwardAPI:
254
+ items:
255
+ - fieldRef:
256
+ fieldPath: metadata.labels
257
+ path: labels
258
+ name: podinfo
259
+ - name: npm-cred
260
+ secret:
261
+ secretName: npm-cred
262
+ podTemplate:
263
+ ImagePullSecrets:
264
+ - name: tekton-container-registry-auth
265
+ hostNetwork: false
266
+ schedulerName: ""
267
+ serviceAccountName: tekton-bot
268
+ timeout: 240h0m0s
269
+ status: {}
@@ -0,0 +1,18 @@
1
+ apiVersion: config.lighthouse.jenkins-x.io/v1alpha1
2
+ kind: TriggerConfig
3
+ spec:
4
+ presubmits:
5
+ - name: pr
6
+ context: "pr"
7
+ always_run: true
8
+ optional: false
9
+ trigger: "/test"
10
+ rerun_command: "/retest"
11
+ source: "pullrequest.yaml"
12
+ postsubmits:
13
+ - name: release
14
+ context: "release"
15
+ source: "release.yaml"
16
+ branches:
17
+ - ^(qa)$
18
+ - ^(team\/.+)$
package/OWNERS ADDED
@@ -0,0 +1,4 @@
1
+ approvers:
2
+ - developers
3
+ reviewers:
4
+ - developers
package/OWNERS_ALIASES ADDED
@@ -0,0 +1,31 @@
1
+ aliases:
2
+ developers:
3
+ - so-nagender
4
+ - so-ravindra
5
+ - somanwal
6
+ - avik-so
7
+ - mderazon
8
+ - so-abahadur
9
+ - amanpreetSO
10
+ - AmitPandeyScheduleonce
11
+ - ashishsatiSO
12
+ - SO-ashusrivastava
13
+ - bharatsinghoh
14
+ - giladgoraly
15
+ - sohimanshu
16
+ - so-kaushal
17
+ - nalingarg
18
+ - so-sdhawan
19
+ - so-shekhar
20
+ - ShivamKe
21
+ - umeshchaudhary
22
+ - ushankar208
23
+ - vaibhavso
24
+ - vinaykumar01
25
+ - yoramwso
26
+ - piyush-so
27
+ - sumitsharma22
28
+ - yuktiarora
29
+ - aakash-ravi
30
+ - rameshwarverma
31
+ - so-hvats
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- Introduction
2
- =
3
- ESLint configuration for micro-services built using Node.js and TypeScript.
4
-
5
- The configuration extends `@typescript-eslint/recommended`, `eslint-plugin-sonarjs`, `prettier` ESLint configurations.
6
-
7
- ## Installation
8
- Using **NPM**
9
- ```sh
10
- npm i --save-dev @oncehub/eslint-config
11
- ```
12
-
13
- Using **Yarn**
14
- ```sh
15
- yarn add --dev @oncehub/eslint-config
16
- ```
17
-
18
- ## Usage
19
- In your `.eslintrc` file, put `@oncehub/eslint-config` under `extends` array as shown below.
20
- ```js
21
- module.exports = {
22
- 'extends': [
23
- '@oncehub/eslint-config'
24
- ]
25
- };
1
+ Introduction
2
+ =
3
+ ESLint configuration for micro-services built using Node.js and TypeScript.
4
+
5
+ The configuration extends `@typescript-eslint/recommended`, `eslint-plugin-sonarjs`, `prettier` ESLint configurations.
6
+
7
+ ## Installation
8
+ Using **NPM**
9
+ ```sh
10
+ npm i --save-dev @oncehub/eslint-config
11
+ ```
12
+
13
+ Using **Yarn**
14
+ ```sh
15
+ yarn add --dev @oncehub/eslint-config
16
+ ```
17
+
18
+ ## Usage
19
+ In your `.eslintrc` file, put `@oncehub/eslint-config` under `extends` array as shown below.
20
+ ```js
21
+ module.exports = {
22
+ 'extends': [
23
+ '@oncehub/eslint-config'
24
+ ]
25
+ };
26
26
  ```
package/deploy.sh ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ node package-deploy/npm-login.js "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"
5
+ npm whoami
6
+ npm i
7
+ npm publish
8
+
9
+ echo "package pushed to myGet successfully"
package/index.js CHANGED
@@ -1,47 +1,47 @@
1
- module.exports = {
2
- 'env': {
3
- 'es6': true,
4
- 'node': true,
5
- },
6
- 'extends': [
7
- 'plugin:@typescript-eslint/recommended',
8
- 'plugin:sonarjs/recommended',
9
- 'prettier'
10
- ],
11
- 'globals': {
12
- 'Atomics': 'readonly',
13
- 'SharedArrayBuffer': 'readonly',
14
- },
15
- 'parser': '@typescript-eslint/parser',
16
- 'parserOptions': {
17
- 'ecmaVersion': 2018,
18
- 'sourceType': 'module',
19
- },
20
- 'plugins': [
21
- '@typescript-eslint',
22
- 'sonarjs'
23
- ],
24
- 'overrides': [
25
- {
26
- 'files': ['**/*(specs|tests)/**', '**/*.spec.ts'],
27
- 'rules': {
28
- '@typescript-eslint/no-empty-function': 'off',
29
- 'sonarjs/no-identical-functions': 'off',
30
- 'sonarjs/no-duplicate-string': 'off'
31
- }
32
- }
33
- ],
34
- 'rules': {
35
- '@typescript-eslint/no-use-before-define': 'off',
36
- '@typescript-eslint/no-inferrable-types': 'off',
37
- '@typescript-eslint/explicit-function-return-type': 'error',
38
- '@typescript-eslint/no-unused-vars': 'error',
39
- '@typescript-eslint/no-explicit-any': 'error',
40
- '@typescript-eslint/interface-name-prefix': 'off',
41
- '@typescript-eslint/consistent-type-assertions': ['error', {
42
- assertionStyle: 'angle-bracket'
43
- }],
44
- '@typescript-eslint/no-explicit-any': 'off',
45
- '@typescript-eslint/explicit-function-return-type': 'off'
46
- }
1
+ module.exports = {
2
+ 'env': {
3
+ 'es6': true,
4
+ 'node': true,
5
+ },
6
+ 'extends': [
7
+ 'plugin:@typescript-eslint/recommended',
8
+ 'plugin:sonarjs/recommended',
9
+ 'prettier'
10
+ ],
11
+ 'globals': {
12
+ 'Atomics': 'readonly',
13
+ 'SharedArrayBuffer': 'readonly',
14
+ },
15
+ 'parser': '@typescript-eslint/parser',
16
+ 'parserOptions': {
17
+ 'ecmaVersion': 2018,
18
+ 'sourceType': 'module',
19
+ },
20
+ 'plugins': [
21
+ '@typescript-eslint',
22
+ 'sonarjs'
23
+ ],
24
+ 'overrides': [
25
+ {
26
+ 'files': ['**/*(specs|tests)/**', '**/*.spec.ts'],
27
+ 'rules': {
28
+ '@typescript-eslint/no-empty-function': 'off',
29
+ 'sonarjs/no-identical-functions': 'off',
30
+ 'sonarjs/no-duplicate-string': 'off'
31
+ }
32
+ }
33
+ ],
34
+ 'rules': {
35
+ '@typescript-eslint/no-use-before-define': 'off',
36
+ '@typescript-eslint/no-inferrable-types': 'off',
37
+ '@typescript-eslint/explicit-function-return-type': 'error',
38
+ '@typescript-eslint/no-unused-vars': 'error',
39
+ '@typescript-eslint/no-explicit-any': 'error',
40
+ '@typescript-eslint/interface-name-prefix': 'off',
41
+ '@typescript-eslint/consistent-type-assertions': ['error', {
42
+ assertionStyle: 'angle-bracket'
43
+ }],
44
+ '@typescript-eslint/no-explicit-any': 'off',
45
+ '@typescript-eslint/explicit-function-return-type': 'off'
46
+ }
47
47
  };
@@ -0,0 +1,14 @@
1
+ let fs = require('fs');
2
+ let path = require('path');
3
+
4
+ let token = '';
5
+
6
+ process.argv.forEach(function(val, index, array) {
7
+ if (index == 2) token = val;
8
+ });
9
+
10
+ let registry = '//registry.npmjs.org/';
11
+
12
+ var configPath = configPath ? configPath : path.join(__dirname, '../', '.npmrc');
13
+
14
+ fs.writeFile(configPath, `${registry}:_authToken=${token}` + '\n', (err, message) => {console.log(err , message)});
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "@oncehub/eslint-config",
3
- "version": "2.0.0",
4
- "description": "ESLint configuration for micro-services built using Node.js and TypeScript",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "Rajat Saxena <rajat.saxena@oncehub.com>",
10
- "license": "ISC",
11
- "dependencies": {
12
- "@typescript-eslint/eslint-plugin": "^4.14.1",
13
- "@typescript-eslint/parser": "^4.14.1",
14
- "eslint": "^7.19.0",
15
- "eslint-config-prettier": "^7.2.0",
16
- "eslint-plugin-sonarjs": "^0.5.0",
17
- "typescript": "^4.1.3"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/scheduleonce/eslint-config-oncehub.git"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/scheduleonce/eslint-config-oncehub/issues"
25
- },
26
- "homepage": "https://github.com/scheduleonce/eslint-config-oncehub#readme"
27
- }
1
+ {
2
+ "name": "@oncehub/eslint-config",
3
+ "version": "2.1.1-beta.2",
4
+ "description": "ESLint configuration for micro-services built using Node.js and TypeScript",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "Rajat Saxena <rajat.saxena@oncehub.com>",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
13
+ "@typescript-eslint/parser": "^5.6.0",
14
+ "eslint": "^8.4.1",
15
+ "eslint-config-prettier": "^8.3.0",
16
+ "eslint-plugin-sonarjs": "^0.11.0",
17
+ "typescript": "^4.1.3"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/scheduleonce/eslint-config-oncehub.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/scheduleonce/eslint-config-oncehub/issues"
25
+ },
26
+ "homepage": "https://github.com/scheduleonce/eslint-config-oncehub#readme"
27
+ }