Skip to content

Commit

Permalink
address eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raclim committed Oct 4, 2024
1 parent 039b51b commit e5a81b6
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions client/common/useKeyDownHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ export const DocumentKeyDown = ({ handlers }) => {
DocumentKeyDown.propTypes = {
handlers: PropTypes.objectOf(PropTypes.func)
};

DocumentKeyDown.defaultProps = {
handlers: {}
};
4 changes: 2 additions & 2 deletions client/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const initialState = window.__INITIAL_STATE__;
const store = configureStore(initialState);

const App = () => (
<>
<div>
<Router history={browserHistory}>
<SkipLink targetId="play-sketch" text="PlaySketch" />
<Routing />
</Router>
</>
</div>
);

render(
Expand Down
4 changes: 2 additions & 2 deletions client/modules/IDE/components/Console.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import resultContrastUrl from '../../../images/console-result-contrast.svg?byUrl
import UpArrowIcon from '../../../images/up-arrow.svg';
import DownArrowIcon from '../../../images/down-arrow.svg';

import * as IDEActions from '../../IDE/actions/ide';
import * as ConsoleActions from '../../IDE/actions/console';
import * as IDEActions from '../actions/ide';
import * as ConsoleActions from '../actions/console';
import { useDidUpdate } from '../hooks/custom-hooks';
import useHandleMessageEvent from '../hooks/useHandleMessageEvent';
import { listen } from '../../../utils/dispatcher';
Expand Down
1 change: 1 addition & 0 deletions client/modules/IDE/components/Editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class Editor extends React.Component {
});
}

/* eslint-disable react/no-deprecated */
componentWillUpdate(nextProps) {
// check if files have changed
if (this.props.files[0].id !== nextProps.files[0].id) {
Expand Down
8 changes: 4 additions & 4 deletions client/modules/User/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function initiateResetPassword(formValues) {
dispatch({
type: ActionTypes.RESET_PASSWORD_INITIATE
});
return apiClient
apiClient
.post('/reset-password', formValues)
.then(() => resolve())
.catch((error) => {
Expand Down Expand Up @@ -246,7 +246,7 @@ export function validateResetPasswordToken(token) {

export function updatePassword(formValues, token) {
return (dispatch) =>
new Promise((resolve) =>
new Promise((resolve) => {
apiClient
.post(`/reset-password/${token}`, formValues)
.then((response) => {
Expand All @@ -259,8 +259,8 @@ export function updatePassword(formValues, token) {
type: ActionTypes.INVALID_RESET_PASSWORD_TOKEN
});
resolve({ error });
})
);
});
});
}

export function updateSettingsSuccess(user) {
Expand Down
1 change: 1 addition & 0 deletions client/store.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-import-module-exports */
import { configureStore } from '@reduxjs/toolkit';
import listenerMiddleware from './middleware';
import DevTools from './modules/App/components/DevTools';
Expand Down
6 changes: 4 additions & 2 deletions client/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// eslint-disable-next-line import/no-extraneous-dependencies
import { render } from '@testing-library/react';
import React from 'react';
import React, { useMemo } from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Router } from 'react-router-dom';
Expand All @@ -34,9 +34,11 @@ export * from '@testing-library/react';

const ResponsiveProvider = ({ children, mobile, deviceWidth }) => {
const width = deviceWidth ?? (mobile ? 400 : 1000);
const value = useMemo(() => ({ width }), [width]);

return (
// eslint-disable-next-line react/jsx-filename-extension
<ResponsiveContext.Provider value={{ width }}>
<ResponsiveContext.Provider value={value}>
{children}
</ResponsiveContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Request, Response } from 'jest-express';

import Project from '../../../models/project';
import User from '../../../models/user';
import deleteProject from '../../project.controller/deleteProject';
import deleteProject from '../deleteProject';
import { deleteObjectsFromS3 } from '../../aws.controller';

jest.mock('../../../models/project');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Request, Response } from 'jest-express';
import User from '../../../models/user';
import getProjectsForUser, {
apiGetProjectsForUser
} from '../../project.controller/getProjectsForUser';
} from '../getProjectsForUser';

jest.mock('../../../models/user');
jest.mock('../../aws.controller');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { last } from 'lodash';
import { Request, Response } from 'jest-express';

import User, { createMock, createInstanceMock } from '../../../models/user';
import { createApiKey, removeApiKey } from '../../user.controller/apiKey';
import { createApiKey, removeApiKey } from '../apiKey';

jest.mock('../../../models/user');

Expand Down
2 changes: 1 addition & 1 deletion server/utils/previewGeneration.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolvePathToFile } from '../utils/filePath';
import { resolvePathToFile } from './filePath';

import {
MEDIA_FILE_REGEX,
Expand Down

0 comments on commit e5a81b6

Please sign in to comment.