Skip to content

Commit 96b0138

Browse files
authored
Merge pull request #1744 from processing/chore/lint-warnings
[#1698] Remove lint warnings
2 parents 1712ffa + 4db9ae0 commit 96b0138

25 files changed

+23
-61
lines changed

Diff for: client/components/Dropdown.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { Link } from 'react-router';
43
import styled from 'styled-components';
5-
import { remSize, prop, common } from '../theme';
4+
import { remSize, prop } from '../theme';
65
import IconButton from './mobile/IconButton';
7-
import Button from '../common/Button';
86

97
const DropdownWrapper = styled.ul`
108
background-color: ${prop('Modal.background')};

Diff for: client/components/mobile/Explorer.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { useTranslation } from 'react-i18next';
3-
import styled from 'styled-components';
43
import PropTypes from 'prop-types';
54
import Sidebar from './Sidebar';
65
import ConnectedFileNode from '../../modules/IDE/components/FileNode';

Diff for: client/components/mobile/FloatingNav.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import styled from 'styled-components';
44
import { remSize, prop } from '../../theme';
5-
import Button from '../../common/Button';
65
import IconButton from './IconButton';
76

87
const FloatingContainer = styled.div`

Diff for: client/components/mobile/Footer.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
21
import styled from 'styled-components';
3-
import { prop, grays } from '../../theme';
2+
import { prop } from '../../theme';
43

54
const background = prop('MobilePanel.default.background');
65
const textColor = prop('primaryTextColor');

Diff for: client/components/mobile/IDEWrapper.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import styled from 'styled-components';
32
import { remSize } from '../../theme';
43

Diff for: client/components/mobile/Sidebar.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { Link } from 'react-router';
43
import styled from 'styled-components';
5-
import { remSize, prop, common } from '../../theme';
4+
import { remSize, prop } from '../../theme';
65
import Header from './Header';
76
import IconButton from './IconButton';
87
import { ExitIcon } from '../../common/icons';

Diff for: client/components/mobile/Tab.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import styled from 'styled-components';
32
import { Link } from 'react-router';
43
import { prop, remSize } from '../../theme';

Diff for: client/components/mobile/TabSwitcher.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React from 'react';
21
import styled from 'styled-components';
32

4-
import { prop, remSize } from '../../theme';
3+
import { prop } from '../../theme';
54

65
export default styled.div`
76
display: flex;

Diff for: client/i18n.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
3-
import LanguageDetector from 'i18next-browser-languagedetector';
43
import Backend from 'i18next-http-backend';
54
import { enUS, es, ja } from 'date-fns/locale';
65

Diff for: client/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import configureStore from './store';
88
import routes from './routes';
99
import ThemeProvider from './modules/App/components/ThemeProvider';
1010
import Loader from './modules/App/components/loader';
11-
import i18n from './i18n';
11+
import './i18n';
1212

1313
require('./styles/main.scss');
1414

Diff for: client/modules/IDE/components/Editor.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class Editor extends React.Component {
9393
componentDidMount() {
9494
this.beep = new Audio(beepUrl);
9595
this.widgets = [];
96-
this._cm = CodeMirror(this.codemirrorContainer, { // eslint-disable-line
96+
this._cm = CodeMirror(this.codemirrorContainer, {
97+
// eslint-disable-line
9798
theme: `p5-${this.props.theme}`,
9899
lineNumbers: this.props.lineNumbers,
99100
styleActiveLine: true,
@@ -141,7 +142,7 @@ class Editor extends React.Component {
141142
[`${metaKey}-F`]: 'findPersistent',
142143
[`${metaKey}-G`]: 'findNext',
143144
[`Shift-${metaKey}-G`]: 'findPrev',
144-
replaceCommand: 'replace'
145+
[replaceCommand]: 'replace'
145146
});
146147

147148
this.initializeDocuments(this.props.files);
@@ -349,7 +350,10 @@ class Editor extends React.Component {
349350
this._docs = {};
350351
files.forEach((file) => {
351352
if (file.name !== 'root') {
352-
this._docs[file.id] = CodeMirror.Doc(file.content, this.getFileMode(file.name)); // eslint-disable-line
353+
this._docs[file.id] = CodeMirror.Doc(
354+
file.content,
355+
this.getFileMode(file.name)
356+
); // eslint-disable-line
353357
}
354358
});
355359
}

Diff for: client/modules/IDE/components/PreviewFrame.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33
import ReactDOM from 'react-dom';
4-
// import escapeStringRegexp from 'escape-string-regexp';
54
import { isEqual } from 'lodash';
65
import srcDoc from 'srcdoc-polyfill';
76
import loopProtect from 'loop-protect';
87
import { JSHINT } from 'jshint';
98
import decomment from 'decomment';
109
import classNames from 'classnames';
11-
import { bindActionCreators } from 'redux';
1210
import { connect } from 'react-redux';
1311
import { Decode } from 'console-feed';
1412
import { getBlobUrl } from '../actions/files';

Diff for: client/modules/IDE/pages/MobileIDEView.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const autosave = (autosaveInterval, setAutosaveInterval) => (
227227

228228
const doAutosave = () => autosaveProject(true);
229229

230-
if (props.isUserOwner && project.id) {
230+
if (isUserOwner && project.id) {
231231
if (preferences.autosave && ide.unsavedChanges && !ide.justOpenedProject) {
232232
if (file.name === oldFile.name && file.content !== oldFile.content) {
233233
if (autosaveInterval) {

Diff for: client/modules/Mobile/MobileDashboardView.jsx

-9
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ import {
1919
SketchSearchbar,
2020
CollectionSearchbar
2121
} from '../IDE/components/Searchbar';
22-
import Button from '../../common/Button';
2322
import useAsModal from '../../components/useAsModal';
2423
import Dropdown from '../../components/Dropdown';
2524
import FooterTabSwitcher from '../../components/mobile/TabSwitcher';
2625
import FooterTab from '../../components/mobile/Tab';
27-
import Loader from '../App/components/loader';
2826

2927
const EXAMPLE_USERNAME = 'p5';
3028

@@ -148,10 +146,6 @@ const Subheader = styled.div`
148146
}
149147
`;
150148

151-
const SubheaderButton = styled(Button)`
152-
border-radius: 0px !important;
153-
`;
154-
155149
const Panels = {
156150
sketches: SketchList,
157151
collections: CollectionList,
@@ -181,9 +175,6 @@ const NavItem = styled.li`
181175
position: relative;
182176
`;
183177

184-
const isOwner = (user, params) =>
185-
user && params && user.username === params.username;
186-
187178
const renderPanel = (name, props) =>
188179
((Component) => Component && <Component {...props} mobile />)(Panels[name]);
189180

Diff for: client/modules/Mobile/MobilePreferences.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React from 'react';
22
import { bindActionCreators } from 'redux';
3-
import { connect, useSelector, useDispatch } from 'react-redux';
3+
import { useSelector, useDispatch } from 'react-redux';
44
import { withRouter } from 'react-router';
55
import { useTranslation } from 'react-i18next';
66

7-
import PropTypes from 'prop-types';
87
import styled from 'styled-components';
98

109
import * as PreferencesActions from '../IDE/actions/preferences';
@@ -17,7 +16,6 @@ import PreferencePicker from '../../components/mobile/PreferencePicker';
1716
import { ExitIcon } from '../../common/icons';
1817
import { remSize, prop } from '../../theme';
1918
import {
20-
optionsOnOff,
2119
optionsPickOne,
2220
preferenceOnOff
2321
} from '../IDE/components/Preferences/PreferenceCreators';

Diff for: client/modules/Mobile/MobileSketchView.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { bindActionCreators } from 'redux';
33
import { useSelector, useDispatch } from 'react-redux';
4-
import styled from 'styled-components';
54
import Header from '../../components/mobile/Header';
65
import IconButton from '../../components/mobile/IconButton';
76
import PreviewFrame from '../IDE/components/PreviewFrame';
@@ -16,7 +15,6 @@ import * as FilesActions from '../IDE/actions/files';
1615
import { getHTMLFile } from '../IDE/reducers/files';
1716

1817
import { ExitIcon } from '../../common/icons';
19-
import { remSize } from '../../theme';
2018
import Footer from '../../components/mobile/Footer';
2119
import Content from './MobileViewContent';
2220

Diff for: client/modules/Mobile/MobileViewContent.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import styled from 'styled-components';
32
import { remSize } from '../../theme';
43

Diff for: client/modules/User/actions.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,7 @@ export function updateSettings(formValues) {
282282
dispatch(setToastText('Toast.SettingsSaved'));
283283
resolve();
284284
})
285-
.catch((error) => {
286-
const { response } = error;
287-
resolve({ error });
288-
})
285+
.catch((error) => resolve({ error }))
289286
);
290287
}
291288

Diff for: client/modules/User/components/ResponsiveForm.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import React from 'react';
21
import styled from 'styled-components';
3-
import PropTypes from 'prop-types';
42
import { remSize } from '../../../theme';
53

64
const ResponsiveForm = styled.div`

Diff for: client/utils/custom-hooks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useState } from 'react';
1+
import { useEffect, useRef, useState } from 'react';
22

33
export const noop = () => {};
44

Diff for: package-lock.json

+3-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
"friendly-words": "^1.1.10",
175175
"htmlhint": "^0.10.1",
176176
"i18next": "^19.4.5",
177-
"i18next-browser-languagedetector": "^4.2.0",
178177
"i18next-http-backend": "^1.0.21",
179178
"is-url": "^1.2.4",
180179
"jest-express": "^1.11.0",

Diff for: server/migrations/emailConsolidation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ mongoose.connection.on('error', () => {
3131
* https://mongodb.github.io/node-mongodb-native
3232
*/
3333

34-
const agg = [
34+
const agg = [ // eslint-disable-line
3535
{
3636
$project: {
3737
email: {

Diff for: server/routes/server.routes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { collectionForUserExists } from '../controllers/collection.controller';
1010

1111
const router = new Router();
1212

13-
const fallback404 = (res) => (exists) =>
13+
const fallback404 = (res) => (exists) => // eslint-disable-line
1414
exists ? res.send(renderIndex()) : get404Sketch((html) => res.send(html));
1515

1616
// this is intended to be a temporary file

Diff for: server/scripts/update-syntax-highlighting.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ request('https://p5js.org/reference/data.json', (err, res) => {
2929

3030
let generatedCode = '/* eslint-disable */ \n';
3131
generatedCode +=
32-
'/* generated: do not edit! helper file for syntax highlighting. generated by update-syntax-highlighting script */ \n';
32+
'/* generated: do not edit! helper file for syntax highlighting.' +
33+
' generated by update-syntax-highlighting script */ \n';
3334
generatedCode +=
3435
'var p5Function = {type: "variable", style: "p5-function"};\n';
3536
generatedCode +=

0 commit comments

Comments
 (0)