Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint: enable rule "prefer-const" #4569

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .ops/aws-setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"prettier"
],
"rules": {
"prefer-const": "error",
"prettier/prettier": "error",
"no-unused-vars": [
"error",
Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"plugin:prettier/recommended"
],
"rules": {
"prefer-const": "error",
"prettier/prettier": "error"
}
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/nuxtPrint.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"@vue/eslint-config-prettier"
],
"rules": {
"prefer-const": "error",
"prettier/prettier": "error",
"vue/component-tags-order": [
"error",
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/campAdmin/DialogPeriodDateEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')
},
},
Expand All @@ -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')
}
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/program/FormScheduleEntryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default {
.isSame(this.$date.utc(this.localScheduleEntry.end), 'day')
},
endTimeValidation() {
let validator = {
const validator = {
required: true,
}

Expand Down
1 change: 1 addition & 0 deletions pdf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@vue/eslint-config-prettier"
],
"rules": {
"prefer-const": "error",
"prettier/prettier": "error",
"vue/component-tags-order": [
"error",
Expand Down
1 change: 1 addition & 0 deletions print/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down