Skip to content

Commit 9dc93e3

Browse files
committed
chore: update linting
1 parent 86d79fe commit 9dc93e3

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const config = createConfig('eslint', {
55
rules: {
66
'import/no-unresolved': 'off',
77
},
8+
globals: {
9+
MathJax: true,
10+
},
811
});
912

1013
config.rules['react/function-component-definition'][1].unnamedComponents = 'arrow-function';

src/components/Prompt/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const Prompt = ({ prompt, defaultOpen }) => {
3535
.replaceAll(staticRegex.link, `a href="${process.env.LMS_BASE_URL}/${baseAssetUrl}$1"`);
3636
return (
3737
<Collapsible title={(<h3 className="py-3">{title}</h3>)} open={open} onToggle={toggleOpen}>
38-
<div className='prompt' dangerouslySetInnerHTML={{ __html: promptWithStaticAssets }} />
38+
<div className="prompt" dangerouslySetInnerHTML={{ __html: promptWithStaticAssets }} />
3939
</Collapsible>
4040
);
4141
};

src/components/TextResponse/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ const TextResponse = ({ response }) => {
99
const { textResponseConfig } = useSubmissionConfig();
1010
const textResponseRef = React.useRef(null);
1111

12+
const { editorType, allowLatexPreview } = textResponseConfig || {};
13+
1214
useEffect(() => {
13-
if (textResponseConfig.allowLatexPreview) {
15+
if (allowLatexPreview) {
1416
MathJax.Hub.Queue(['Typeset', MathJax.Hub, textResponseRef.current]);
1517
}
16-
}, [response]);
18+
}, [allowLatexPreview, response]);
1719

1820
return (
1921
<div ref={textResponseRef} className="my-2 p-2 bg-white">
20-
{textResponseConfig.editorType === 'text' ? (
22+
{editorType === 'text' ? (
2123
<div className="div-textarea p-1" dangerouslySetInnerHTML={{ __html: response }} />
2224
) : (
2325
<div dangerouslySetInnerHTML={{ __html: response }} />

src/views/SubmissionView/TextResponseEditor/LaTexPreview.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const LatexPreview = ({ latexValue }) => {
99
}, [latexValue]);
1010

1111
return (
12-
<div ref={latexPreviewEl} className='mt-2'>
12+
<div ref={latexPreviewEl} className="mt-2">
1313
<div dangerouslySetInnerHTML={{ __html: latexValue }} />
1414
</div>
1515
);

src/views/SubmissionView/TextResponseEditor/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const TextResponseEditor = ({ value, onChange }) => {
2121
const { formatMessage } = useIntl();
2222

2323
const [latexValue, setLatexValue] = React.useState('');
24-
24+
2525
const previewLaTex = useCallback(() => {
2626
setLatexValue(value);
2727
}, [value]);

src/views/SubmissionView/TextResponseEditor/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const messages = defineMessages({
2525
defaultMessage: 'Preview in LaTeX',
2626
description: 'Label for the preview LaTeX button',
2727
id: 'frontend-app-ora.TextResponse.previewLaTexButton',
28-
}
28+
},
2929
});
3030

3131
export default messages;

0 commit comments

Comments
 (0)