Skip to content

Commit

Permalink
chore(lint): enforce triple-equals
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Dec 14, 2019
1 parent 88a5c95 commit 8009310
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dashboard/src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function registerValidSW(swUrl, config) {
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing
if (installingWorker == null) {
if (installingWorker === null) {
return
}
installingWorker.onstatechange = () => {
Expand Down Expand Up @@ -112,7 +112,7 @@ function checkValidServiceWorker(swUrl, config) {
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get("content-type")
if (response.status === 404 || (contentType != null && contentType.indexOf("javascript") === -1)) {
if (response.status === 404 || (contentType !== null && contentType.indexOf("javascript") === -1)) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready
.then((registration) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export async function deployContainerServiceBlueGreen(
// Update service (divert traffic from Blue to Green)

// First patch the generated service to point to the new version of the deployment
const serviceManifest = find(manifests, (manifest) => manifest.kind == "Service")
const serviceManifest = find(manifests, (manifest) => manifest.kind === "Service")
const patchedServiceManifest = merge(serviceManifest, servicePatchBody)
// Compare with the deployed Service
const result = await compareDeployedResources(k8sCtx, api, namespace, [patchedServiceManifest], log)
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/status/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export async function compareDeployedResources(

// NOTE: this approach won't fly in the long run, but hopefully we can climb out of this mess when
// `kubectl diff` is ready, or server-side apply/diff is ready
if (manifest.kind === "DaemonSet" || manifest.kind === "Deployment" || manifest.kind == "StatefulSet") {
if (manifest.kind === "DaemonSet" || manifest.kind === "Deployment" || manifest.kind === "StatefulSet") {
// handle properties that are omitted in the response because they have the default value
// (another design issue in the K8s API)
if (manifest.spec.minReadySeconds === 0) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
"check-package-lock": "git diff --quiet HEAD -- package-lock.json || (echo 'package-lock.json is dirty!' && exit 1)",
"check-all": "npm run check-docs && npm run check-package-lock && npm run check-licenses && npm run lint",
"clean": "lerna run clean && git clean -X -f && find . -name \".garden\" -type d -prune -exec rm -rf '{}' '+'",
"fix-format": "lerna run fix-format",
"fix-format": "lerna run fix-format --no-bail",
"generate-docs": "lerna run generate-docs",
"integ": "lerna run integ",
"lint": "lerna run lint && gulp check-licenses",
"test": "lerna run test"
"lint": "lerna run lint --no-bail && gulp check-licenses",
"test": "lerna run test --no-bail"
},
"husky": {
"hooks": {
Expand Down
1 change: 1 addition & 0 deletions tslint.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"allow-leading-underscore",
"allow-pascal-case"
],
"triple-equals": true,
"whitespace": [true, "check-branch", "check-operator", "check-separator"]
}
}

0 comments on commit 8009310

Please sign in to comment.