diff --git a/.ops/aws-setup/package.json b/.ops/aws-setup/package.json index 7b7b9db972..5e2a2f3f1f 100644 --- a/.ops/aws-setup/package.json +++ b/.ops/aws-setup/package.json @@ -36,6 +36,7 @@ "prettier" ], "rules": { + "prefer-const": "error", "prettier/prettier": "error", "no-unused-vars": [ "error", diff --git a/e2e/package.json b/e2e/package.json index 991c6f6e76..707578ffe6 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -30,6 +30,7 @@ "plugin:prettier/recommended" ], "rules": { + "prefer-const": "error", "prettier/prettier": "error" } } diff --git a/e2e/specs/nuxtPrint.cy.js b/e2e/specs/nuxtPrint.cy.js index 99f450b7bf..e9938c0b04 100644 --- a/e2e/specs/nuxtPrint.cy.js +++ b/e2e/specs/nuxtPrint.cy.js @@ -11,7 +11,7 @@ describe('Nuxt print test', () => { const campUri = body._links.items[1].href const camp = body._embedded.items[1] - let printConfig = { + const printConfig = { language: 'en', documentName: 'camp', camp: campUri, diff --git a/frontend/package.json b/frontend/package.json index 033da40bf7..b9fb201f5e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -130,6 +130,7 @@ "@vue/eslint-config-prettier" ], "rules": { + "prefer-const": "error", "prettier/prettier": "error", "vue/component-tags-order": [ "error", diff --git a/frontend/src/components/campAdmin/DialogPeriodDateEdit.vue b/frontend/src/components/campAdmin/DialogPeriodDateEdit.vue index 18dd362601..d725df35c7 100644 --- a/frontend/src/components/campAdmin/DialogPeriodDateEdit.vue +++ b/frontend/src/components/campAdmin/DialogPeriodDateEdit.vue @@ -118,8 +118,8 @@ export default { return this.$date.utc(this.entityData.end, 'YYYY-MM-DD').format('L') }, periodDurationInDays() { - let start = this.$date.utc(this.entityData.start, 'YYYY-MM-DD') - let end = this.$date.utc(this.entityData.end, 'YYYY-MM-DD') + const start = this.$date.utc(this.entityData.start, 'YYYY-MM-DD') + const end = this.$date.utc(this.entityData.end, 'YYYY-MM-DD') return 1 + end.diff(start, 'day') }, }, @@ -139,11 +139,11 @@ export default { methods: { startChanged() { if (this.mode == 'move') { - let origStart = this.$date.utc(this.period.start, 'YYYY-MM-DD') - let origEnd = this.$date.utc(this.period.end, 'YYYY-MM-DD') - let origLength = origEnd - origStart - let start = this.$date.utc(this.entityData.start, 'YYYY-MM-DD') - let end = start.add(origLength) + const origStart = this.$date.utc(this.period.start, 'YYYY-MM-DD') + const origEnd = this.$date.utc(this.period.end, 'YYYY-MM-DD') + const origLength = origEnd - origStart + const start = this.$date.utc(this.entityData.start, 'YYYY-MM-DD') + const end = start.add(origLength) this.entityData.end = end.format('YYYY-MM-DD') } }, diff --git a/frontend/src/components/program/FormScheduleEntryItem.vue b/frontend/src/components/program/FormScheduleEntryItem.vue index 24fe5c35f3..36afabbb47 100644 --- a/frontend/src/components/program/FormScheduleEntryItem.vue +++ b/frontend/src/components/program/FormScheduleEntryItem.vue @@ -111,7 +111,7 @@ export default { .isSame(this.$date.utc(this.localScheduleEntry.end), 'day') }, endTimeValidation() { - let validator = { + const validator = { required: true, } diff --git a/pdf/package.json b/pdf/package.json index f6724b5df7..8cb9c4368e 100644 --- a/pdf/package.json +++ b/pdf/package.json @@ -67,6 +67,7 @@ "@vue/eslint-config-prettier" ], "rules": { + "prefer-const": "error", "prettier/prettier": "error", "vue/component-tags-order": [ "error", diff --git a/print/package.json b/print/package.json index adf7c92fcc..5f99a6f006 100644 --- a/print/package.json +++ b/print/package.json @@ -70,6 +70,7 @@ "no-undef": "off", "no-console": "off", "prettier/prettier": "error", + "prefer-const": "error", "vue/multi-word-component-names": "off", "local-rules/matching-translation-keys": [ "error",