fix: lint both js and jsx files.

Updating jsx to pass linter, too.
This commit is contained in:
David Joy
2020-02-04 14:58:19 -05:00
parent ee4908565f
commit ec7166ad5d
4 changed files with 12 additions and 6 deletions

View File

@@ -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"

View File

@@ -42,7 +42,6 @@ function useLoadCourse(courseUsageKey) {
setCourseId(blocksData.root);
});
getCourse(courseUsageKey).then((data) => {
console.log(data);
setMetadata(camelCaseObject(data));
});
}, [courseUsageKey]);

View File

@@ -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}
/>
));

View File

@@ -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,
};