Skip to content

Commit 86b538a

Browse files
chore: fix various eslint warnings
1 parent 48ba65e commit 86b538a

29 files changed

+303
-73
lines changed

.eslintrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('path');
12
// eslint-disable-next-line import/no-extraneous-dependencies
23
const { createConfig } = require('@edx/frontend-build');
34

@@ -13,5 +14,21 @@ module.exports = createConfig(
1314
indent: ['error', 2],
1415
'no-restricted-exports': 'off',
1516
},
17+
settings: {
18+
// Import URLs should be resolved using aliases
19+
'import/resolver': {
20+
webpack: {
21+
config: path.resolve(__dirname, 'webpack.dev.config.js'),
22+
},
23+
},
24+
},
25+
overrides: [
26+
{
27+
files: ['plugins/**/*.test.jsx', 'some-other-repo/plugins/**/*.test.jsx'],
28+
rules: {
29+
'import/no-extraneous-dependencies': 'off',
30+
},
31+
},
32+
],
1633
},
1734
);

package-lock.json

Lines changed: 132 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"classnames": "2.2.6",
6161
"core-js": "3.8.1",
6262
"email-validator": "2.0.4",
63+
"eslint-import-resolver-webpack": "^0.13.8",
6364
"file-saver": "^2.0.5",
6465
"formik": "2.2.6",
6566
"jszip": "^3.10.1",

plugins/course-apps/calculator/Settings.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
import { useIntl } from '@edx/frontend-platform/i18n';
45

@@ -7,8 +8,7 @@ import messages from './messages';
78

89
/**
910
* Settings widget for the "calculator" Course App.
10-
* @param {{onClose: () => void}} props
11-
* @returns
11+
* @param {{onClose: () => void}} props
1212
*/
1313
const CalculatorSettings = ({ onClose }) => {
1414
const intl = useIntl();
@@ -24,4 +24,8 @@ const CalculatorSettings = ({ onClose }) => {
2424
);
2525
};
2626

27+
CalculatorSettings.propTypes = {
28+
onClose: PropTypes.func.isRequired,
29+
};
30+
2731
export default CalculatorSettings;
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "@openedx-plugins/course-app-calculator",
33
"version": "0.1.0",
4-
"description": "Calculator configuration for courses using it"
4+
"description": "Calculator configuration for courses using it",
5+
"peerDependencies": {
6+
"@edx/frontend-app-course-authoring": "*",
7+
"@edx/frontend-platform": "*",
8+
"@edx/paragon": "*",
9+
"prop-types": "*",
10+
"react": "*"
11+
}
512
}
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
import { useIntl } from '@edx/frontend-platform/i18n';
45

@@ -7,8 +8,7 @@ import messages from './messages';
78

89
/**
910
* Settings widget for the "edxnotes" Course App.
10-
* @param {{onClose: () => void}} props
11-
* @returns
11+
* @param {{onClose: () => void}} props
1212
*/
1313
const NotesSettings = ({ onClose }) => {
1414
const intl = useIntl();
@@ -21,7 +21,11 @@ const NotesSettings = ({ onClose }) => {
2121
learnMoreText={intl.formatMessage(messages.enableNotesLink)}
2222
onClose={onClose}
2323
/>
24-
);
25-
};
26-
27-
export default NotesSettings;
24+
);
25+
};
26+
27+
NotesSettings.propTypes = {
28+
onClose: PropTypes.func.isRequired,
29+
};
30+
31+
export default NotesSettings;
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"name": "@openedx-plugins/course-app-edxnotes",
33
"version": "0.1.0",
4-
"description": "edxnotes configuration for courses using it"
4+
"description": "edxnotes configuration for courses using it",
5+
"peerDependencies": {
6+
"@edx/frontend-app-course-authoring": "*",
7+
"@edx/frontend-platform": "*",
8+
"@edx/paragon": "*",
9+
"prop-types": "*",
10+
"react": "*"
11+
}
512
}

plugins/course-apps/live/BBBSettings.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { getConfig } from '@edx/frontend-platform';
33
import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n';
44
import { Form, Hyperlink } from '@edx/paragon';
55
import PropTypes from 'prop-types';
6-
import messages from './messages';
7-
import { providerNames, bbbPlanTypes } from './constants';
86
import AppConfigFormDivider from 'CourseAuthoring/pages-and-resources/discussions/app-config-form/apps/shared/AppConfigFormDivider';
9-
import LiveCommonFields from './LiveCommonFields';
107
import { useModel } from 'CourseAuthoring/generic/model-store';
118

9+
import { providerNames, bbbPlanTypes } from './constants';
10+
import LiveCommonFields from './LiveCommonFields';
11+
import messages from './messages';
12+
1213
const BbbSettings = ({
1314
intl,
1415
values,

plugins/course-apps/live/BbbSettings.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ import { IntlProvider } from '@edx/frontend-platform/i18n';
1717
import userEvent from '@testing-library/user-event';
1818
import initializeStore from 'CourseAuthoring/store';
1919
import { executeThunk } from 'CourseAuthoring/utils';
20+
import PagesAndResourcesProvider from 'CourseAuthoring/pages-and-resources/PagesAndResourcesProvider';
21+
2022
import LiveSettings from './Settings';
2123
import {
2224
generateLiveConfigurationApiResponse,
2325
courseId,
2426
initialState,
2527
configurationProviders,
2628
} from './factories/mockApiResponses';
27-
2829
import { fetchLiveConfiguration, fetchLiveProviders } from './data/thunks';
2930
import { providerConfigurationApiUrl, providersApiUrl } from './data/api';
3031
import messages from './messages';
31-
import PagesAndResourcesProvider from '../PagesAndResourcesProvider';
3232

3333
let axiosMock;
3434
let container;

plugins/course-apps/live/LiveCommonFields.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
22
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
33
import PropTypes from 'prop-types';
4-
import messages from './messages';
54
import FormikControl from 'CourseAuthoring/generic/FormikControl';
65

6+
import messages from './messages';
7+
78
const LiveCommonFields = ({
89
intl,
910
values,

0 commit comments

Comments
 (0)