Use const when variable never reassigned

Test plan:
  - Existing test pass

Refs DE-1426

flag=none

Change-Id: I01a3a0eec63c79c154089c6b7935201032ef5113
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303158
Reviewed-by: Paulo Chaves <paulo.chaves@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
This commit is contained in:
Aaron Shafovaloff 2022-10-12 15:19:33 -06:00
parent fcbad8eb61
commit b569e750d7
6 changed files with 14 additions and 16 deletions

View File

@ -115,10 +115,10 @@ CollaborationsPage.Events = {
},
onTypeChange(_e) {
let name = $(this).val(),
type = name,
launch_url = $(this).find('option:selected').data('launch-url'),
$description
const name = $(this).val()
let type = name
const launch_url = $(this).find('option:selected').data('launch-url')
let $description
if (launch_url) {
$('.collaborate_data, #google_docs_description').hide()

View File

@ -85,7 +85,6 @@ var GradePublishing = {
})
},
publish() {
let confirmMessage
if (
GradePublishing.status === 'publishing' ||
GradePublishing.status === 'pending' ||
@ -94,7 +93,7 @@ var GradePublishing = {
return
}
confirmMessage =
const confirmMessage =
GradePublishing.status === 'published'
? I18n.t('Are you sure you want to resync these grades to the student information system?')
: I18n.t(

View File

@ -63,12 +63,10 @@ class CourseListItem extends React.Component {
}
getDisplayTimestamp = () => {
let timestamp
if (_.isEmpty(this.epubExport())) {
return null
}
timestamp = this.epubExport().updated_at
const timestamp = this.epubExport().updated_at
return <FriendlyDatetime dateTime={timestamp} />
}

View File

@ -89,10 +89,10 @@ export default createReactClass({
},
handleChange(e) {
let target = e.target,
value = target.value,
name = $(target).data('rel'),
fields = this.state.fields
const target = e.target
let value = target.value
const name = $(target).data('rel')
const fields = this.state.fields
if (target.type === 'checkbox') {
value = target.checked

View File

@ -74,8 +74,8 @@ class SectionMenuView extends View {
return e.preventDefault()
})
return this.$('.section-select-menu').on('menuselect', (event, ui) => {
let section
section = this.$('[aria-checked=true] input[name=section_to_show_radio]').val() || undefined
const section =
this.$('[aria-checked=true] input[name=section_to_show_radio]').val() || undefined
$.publish('currentSection/change', [section, this.cid])
return this.trigger('menuselect', event, ui, this.currentSection)
})

View File

@ -172,7 +172,8 @@ export default class ThemeEditor extends React.Component {
}
handleThemeStateChange = (key, value, opts = {}) => {
let {files, properties} = this.state.themeStore
const {files} = this.state.themeStore
let {properties} = this.state.themeStore
if (value instanceof File) {
const fileStorageObject = {
variable_name: key,