chore: update imports, fix lint issues

This commit is contained in:
Braden MacDonald
2024-08-09 12:49:28 -07:00
parent afa2317131
commit 28e1956708
292 changed files with 1074 additions and 1012 deletions

View File

@@ -2,7 +2,7 @@
/* eslint no-eval: 0 */
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import _ from 'lodash-es';
import _ from 'lodash';
import { ProblemTypeKeys, RichTextProblems, settingsOlxAttributes } from '../../../data/constants/problem';
export const indexToLetterMap = [...Array(26)].map((val, i) => String.fromCharCode(i + 65));
@@ -719,9 +719,9 @@ export class OLXParser {
if (!toleranceValue || toleranceValue.length === 0) {
settings.tolerance = { value: null, type: 'None' };
} else if (toleranceValue.includes('%')) {
settings.tolerance = { value: parseInt(toleranceValue.slice(0, -1)), type: 'Percent' };
settings.tolerance = { value: parseInt(toleranceValue.slice(0, -1), 10), type: 'Percent' };
} else {
settings.tolerance = { value: parseInt(toleranceValue), type: 'Number' };
settings.tolerance = { value: parseInt(toleranceValue, 10), type: 'Number' };
}
} else {
settings.tolerance = { value: null, type: 'None' };

View File

@@ -1,4 +1,4 @@
import _ from 'lodash-es';
import _ from 'lodash';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { ProblemTypeKeys } from '../../../data/constants/problem';
import { ToleranceTypes } from '../components/EditProblemView/SettingsWidget/settingsComponents/Tolerance/constants';

View File

@@ -1,5 +1,5 @@
import { XMLParser } from 'fast-xml-parser';
import _ from 'lodash-es';
import _ from 'lodash';
import {
ShowAnswerTypesKeys,
@@ -61,7 +61,7 @@ class ReactStateSettingsParser {
const attributeKey = attribute.substring(2);
if (SETTING_KEYS.includes(attributeKey)) {
if (attributeKey === 'max_attempts' || attributeKey === 'weight') {
rawOlxSettings[attributeKey] = parseInt(olx.problem[attribute]);
rawOlxSettings[attributeKey] = parseInt(olx.problem[attribute], 10);
} else {
rawOlxSettings[attributeKey] = olx.problem[attribute];
}

View File

@@ -1,4 +1,4 @@
import _ from 'lodash-es';
import _ from 'lodash';
import { ShowAnswerTypes, RandomizationTypesKeys } from '../../../data/constants/problem';

View File

@@ -1,6 +1,6 @@
/* eslint-disable import/prefer-default-export */
import flatten from 'lodash.flatten';
import { flatten } from 'lodash';
/**
* flattenSubNodes - appends a nodes children to a given array 'subNodes' in a flattened format.