fix: lint both js and jsx files.
Updating jsx to pass linter, too.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"build": "fedx-scripts webpack",
|
||||
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
|
||||
"is-es5": "es-check es5 ./dist/*.js",
|
||||
"lint": "fedx-scripts eslint",
|
||||
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
|
||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||
"start": "fedx-scripts webpack-dev-server --progress",
|
||||
"test": "fedx-scripts jest --coverage --passWithNoTests"
|
||||
|
||||
@@ -42,7 +42,6 @@ function useLoadCourse(courseUsageKey) {
|
||||
setCourseId(blocksData.root);
|
||||
});
|
||||
getCourse(courseUsageKey).then((data) => {
|
||||
console.log(data);
|
||||
setMetadata(camelCaseObject(data));
|
||||
});
|
||||
}, [courseUsageKey]);
|
||||
|
||||
@@ -19,7 +19,8 @@ export default function SequenceNavigation({
|
||||
key={unit.id}
|
||||
{...unit}
|
||||
isComplete={showCompletion && unit.complete}
|
||||
onClick={onNavigate.bind(null, index)}
|
||||
index={index}
|
||||
clickHandler={onNavigate}
|
||||
/>
|
||||
));
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import { Button } from '@edx/paragon';
|
||||
@@ -7,12 +7,17 @@ import UnitIcon from './UnitIcon';
|
||||
import CompleteIcon from './CompleteIcon';
|
||||
|
||||
export default function UnitButton({
|
||||
onClick,
|
||||
clickHandler,
|
||||
pageTitle,
|
||||
type,
|
||||
isActive,
|
||||
isComplete,
|
||||
index,
|
||||
}) {
|
||||
const onClick = useCallback(() => {
|
||||
clickHandler(index);
|
||||
});
|
||||
|
||||
return (
|
||||
<Button
|
||||
className={classNames({
|
||||
@@ -31,9 +36,10 @@ export default function UnitButton({
|
||||
}
|
||||
|
||||
UnitButton.propTypes = {
|
||||
index: PropTypes.number.isRequired,
|
||||
isActive: PropTypes.bool,
|
||||
isComplete: PropTypes.bool,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
clickHandler: PropTypes.func.isRequired,
|
||||
pageTitle: PropTypes.string.isRequired,
|
||||
type: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user