Resolve or disable misc eslint errors

Test plan:
    - All existing tests pass

flag=none

Refs DE-1426

Change-Id: I2ecc43fb8a37720b4e80edc1bed3c4e4d55afa8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303531
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@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>
This commit is contained in:
Aaron Shafovaloff 2022-10-18 15:49:40 -06:00
parent ec9defc536
commit 1e78ace96f
9 changed files with 23 additions and 20 deletions

View File

@ -18,6 +18,7 @@
import {useScope as useI18nScope} from '@canvas/i18n'
import _ from 'underscore'
import template from './jst/UploadMediaTrackForm.handlebars'
// eslint-disable-next-line import/no-cycle
import mejs from './index'
import $ from 'jquery'

View File

@ -76,6 +76,7 @@ export const attachmentProp = PropTypes.shape({
display_name: PropTypes.string,
thumbnail_url: PropTypes.string,
mime_class: PropTypes.string,
isLoading: PropTypes.bool,
})
Attachment.propTypes = {

View File

@ -145,7 +145,8 @@ class MessageStudents extends React.Component {
}
handleChange(field, value) {
let {data, errors} = this.state
let {data} = this.state
const {errors} = this.state
const newData = {}
newData[field] = value
data = {...data, ...newData}

View File

@ -52,7 +52,7 @@ let msfInstanceCounter = 0
$.fn.moduleSequenceFooter = function (options = {}) {
// You must pass in a assetType and assetId or we throw an error.
if (!options.assetType || !options.assetID) {
throw 'Option must be set with assetType and assetID'
throw new Error('Option must be set with assetType and assetID')
}
this.msfAnimation = enabled =>

View File

@ -85,7 +85,6 @@ function CanvasMultiSelect(props) {
function renderChildren() {
function renderOption(child) {
// eslint-disable-next-line no-shadow
const {id, children, ...optionProps} = child.props
return (
<Select.Option

View File

@ -42,8 +42,8 @@ const find_outcome = (function () {
{},
data => {
const valids = []
for (var idx in data) {
var outcome = data[idx].learning_outcome
for (const idx in data) {
const outcome = data[idx].learning_outcome
if (!options.for_rubric || (outcome.data && outcome.data.rubric_criterion)) {
valids.push(outcome)
}
@ -62,8 +62,8 @@ const find_outcome = (function () {
} else {
$dialog.find('.loading_message').hide()
$dialog.addClass('loaded')
for (var idx in valids) {
var outcome = valids[idx]
for (const idx in valids) {
const outcome = valids[idx]
outcome.name = outcome.short_description
outcome.mastery_points =
outcome.data.rubric_criterion.mastery_points ||

View File

@ -30,6 +30,7 @@ jest.mock('@canvas/alerts/react/FlashAlert')
const flushAllTimersAndPromises = async () => {
while (jest.getTimerCount() > 0) {
// eslint-disable-next-line no-await-in-loop
await act(async () => {
jest.runAllTimers()
})

View File

@ -333,6 +333,7 @@ class FileBrowser extends React.Component {
const folderKey = Object.keys(collections).find(key => {
const items = collections[key].items
if (items && items.includes(file.id)) return key
return false
})
return collections[folderKey]
}

View File

@ -29,6 +29,7 @@
//
export const RCELOADED_EVENT_NAME = 'RceLoaded'
// eslint-disable-next-line import/no-mutable-exports
export let tmce
function delaySend($target, methodName, ...args) {
@ -56,7 +57,6 @@ export function send($target, methodName, ...args) {
const remoteEditor = $target.data('remoteEditor') || $target[0]?.remoteEditor
if (remoteEditor) {
let ret
if (methodName === 'get_code' && remoteEditor.isHidden()) {
return $target.val()
}
@ -69,7 +69,7 @@ export function send($target, methodName, ...args) {
const dataAttributes = args[0].dataAttributes
args[0]['data-preview-alt'] = dataAttributes && dataAttributes['preview-alt']
}
ret = remoteEditor.call(methodName, ...args)
const ret = remoteEditor.call(methodName, ...args)
if (methodName === 'toggle') {
if ($target.is(':visible')) {
$target.focus()
@ -78,19 +78,18 @@ export function send($target, methodName, ...args) {
}
}
return ret
} else {
// we're not set up, so tell the caller that `exists?` is false,
// `get_code` is the textarea value, and ignore anything else.
if (methodName === 'exists?') {
return false
} else if (methodName === 'get_code') {
return $target.val()
} else {
console.warn(
`called send('${methodName}') on an RCE instance that hasn't fully loaded, delaying send`
)
delaySend($target, methodName, ...args)
}
} else if (methodName === 'exists?') {
return false
} else if (methodName === 'get_code') {
return $target.val()
} else {
// eslint-disable-next-line no-console
console.warn(
`called send('${methodName}') on an RCE instance that hasn't fully loaded, delaying send`
)
delaySend($target, methodName, ...args)
}
}