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) { onTypeChange(_e) {
let name = $(this).val(), const name = $(this).val()
type = name, let type = name
launch_url = $(this).find('option:selected').data('launch-url'), const launch_url = $(this).find('option:selected').data('launch-url')
$description let $description
if (launch_url) { if (launch_url) {
$('.collaborate_data, #google_docs_description').hide() $('.collaborate_data, #google_docs_description').hide()

View File

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

View File

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

View File

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

View File

@ -74,8 +74,8 @@ class SectionMenuView extends View {
return e.preventDefault() return e.preventDefault()
}) })
return this.$('.section-select-menu').on('menuselect', (event, ui) => { return this.$('.section-select-menu').on('menuselect', (event, ui) => {
let section const section =
section = this.$('[aria-checked=true] input[name=section_to_show_radio]').val() || undefined this.$('[aria-checked=true] input[name=section_to_show_radio]').val() || undefined
$.publish('currentSection/change', [section, this.cid]) $.publish('currentSection/change', [section, this.cid])
return this.trigger('menuselect', event, ui, this.currentSection) 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 = {}) => { handleThemeStateChange = (key, value, opts = {}) => {
let {files, properties} = this.state.themeStore const {files} = this.state.themeStore
let {properties} = this.state.themeStore
if (value instanceof File) { if (value instanceof File) {
const fileStorageObject = { const fileStorageObject = {
variable_name: key, variable_name: key,