Skip to content

Commit 87df250

Browse files
committed
Revert "fix: linting"
This reverts commit 1c3748d.
1 parent 7eccdd8 commit 87df250

File tree

12 files changed

+72
-68
lines changed

12 files changed

+72
-68
lines changed

client/components/Nav/NavDropdownMenu.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ function NavDropdownMenu({ id, title, children }) {
1111

1212
const { createDropdownHandlers } = useContext(NavBarContext);
1313

14-
const handlers = useMemo(
15-
() => createDropdownHandlers(id),
16-
[createDropdownHandlers, id]
17-
);
14+
const handlers = useMemo(() => createDropdownHandlers(id), [
15+
createDropdownHandlers,
16+
id
17+
]);
1818

1919
return (
2020
<li className={classNames('nav__item', isOpen && 'nav__item--open')}>

client/components/Nav/NavMenuItem.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ function NavMenuItem({ hideIf, ...rest }) {
88

99
const { createMenuItemHandlers } = useContext(NavBarContext);
1010

11-
const handlers = useMemo(
12-
() => createMenuItemHandlers(parent),
13-
[createMenuItemHandlers, parent]
14-
);
11+
const handlers = useMemo(() => createMenuItemHandlers(parent), [
12+
createMenuItemHandlers,
13+
parent
14+
]);
1515

1616
if (hideIf) {
1717
return null;

client/components/createRedirectWithUsername.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function mapStateToProps(state) {
2222

2323
const ConnectedRedirectToUser = connect(mapStateToProps)(RedirectToUser);
2424

25-
const createRedirectWithUsername = (url) => (props) =>
26-
<ConnectedRedirectToUser {...props} url={url} />;
25+
const createRedirectWithUsername = (url) => (props) => (
26+
<ConnectedRedirectToUser {...props} url={url} />
27+
);
2728

2829
export default createRedirectWithUsername;

client/modules/IDE/components/Console.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,12 @@ const Console = () => {
206206
const isExpanded = useSelector((state) => state.ide.consoleIsExpanded);
207207
const isPlaying = useSelector((state) => state.ide.isPlaying);
208208
const { theme, fontSize } = useSelector((state) => state.preferences);
209-
const { collapseConsole, expandConsole, clearConsole, dispatchConsoleEvent } =
210-
bindActionCreators({ ...IDEActions, ...ConsoleActions }, useDispatch());
209+
const {
210+
collapseConsole,
211+
expandConsole,
212+
clearConsole,
213+
dispatchConsoleEvent
214+
} = bindActionCreators({ ...IDEActions, ...ConsoleActions }, useDispatch());
211215

212216
const cm = useRef({});
213217

client/modules/IDE/components/FileNode.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ function parseFileName(name) {
4040
}
4141

4242
function FileName({ name }) {
43-
const { baseName, firstLetter, lastLetter, middleText, extension } =
44-
parseFileName(name);
43+
const {
44+
baseName,
45+
firstLetter,
46+
lastLetter,
47+
middleText,
48+
extension
49+
} = parseFileName(name);
4550
return (
4651
<span className="sidebar__file-item-name-text">
4752
<span>{firstLetter}</span>

client/modules/IDE/components/Toolbar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class Toolbar extends React.Component {
8686
});
8787
const nameContainerClass = classNames({
8888
'toolbar__project-name-container': true,
89-
'toolbar__project-name-container--editing':
90-
this.props.project.isEditingName
89+
'toolbar__project-name-container--editing': this.props.project
90+
.isEditingName
9191
});
9292

9393
const canEditProjectName = this.canEditProjectName();

client/modules/IDE/pages/MobileIDEView.jsx

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -210,43 +210,41 @@ const handleGlobalKeydown = (props, cmController) => (e) => {
210210
}
211211
};
212212

213-
const autosave =
214-
(autosaveInterval, setAutosaveInterval) => (props, prevProps) => {
215-
const {
216-
autosaveProject,
217-
preferences,
218-
ide,
219-
selectedFile: file,
220-
project,
221-
isUserOwner
222-
} = props;
223-
224-
const { selectedFile: oldFile } = prevProps;
225-
226-
const doAutosave = () => autosaveProject(true);
227-
228-
if (isUserOwner && project.id) {
229-
if (
230-
preferences.autosave &&
231-
ide.unsavedChanges &&
232-
!ide.justOpenedProject
233-
) {
234-
if (file.name === oldFile.name && file.content !== oldFile.content) {
235-
if (autosaveInterval) {
236-
clearTimeout(autosaveInterval);
237-
}
238-
console.log('will save project in 20 seconds');
239-
setAutosaveInterval(setTimeout(doAutosave, 20000));
213+
const autosave = (autosaveInterval, setAutosaveInterval) => (
214+
props,
215+
prevProps
216+
) => {
217+
const {
218+
autosaveProject,
219+
preferences,
220+
ide,
221+
selectedFile: file,
222+
project,
223+
isUserOwner
224+
} = props;
225+
226+
const { selectedFile: oldFile } = prevProps;
227+
228+
const doAutosave = () => autosaveProject(true);
229+
230+
if (isUserOwner && project.id) {
231+
if (preferences.autosave && ide.unsavedChanges && !ide.justOpenedProject) {
232+
if (file.name === oldFile.name && file.content !== oldFile.content) {
233+
if (autosaveInterval) {
234+
clearTimeout(autosaveInterval);
240235
}
241-
} else if (autosaveInterval && !preferences.autosave) {
242-
clearTimeout(autosaveInterval);
243-
setAutosaveInterval(null);
236+
console.log('will save project in 20 seconds');
237+
setAutosaveInterval(setTimeout(doAutosave, 20000));
244238
}
245-
} else if (autosaveInterval) {
239+
} else if (autosaveInterval && !preferences.autosave) {
246240
clearTimeout(autosaveInterval);
247241
setAutosaveInterval(null);
248242
}
249-
};
243+
} else if (autosaveInterval) {
244+
clearTimeout(autosaveInterval);
245+
setAutosaveInterval(null);
246+
}
247+
};
250248

251249
// ide, preferences, project, selectedFile, user, params, unsavedChanges, expandConsole, collapseConsole,
252250
// stopSketch, startSketch, getProject, clearPersistedState, autosaveProject, saveProject, files

client/utils/responsive.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ export const mobileFirst = (MobileComponent, Fallback) => (props) => {
2020
);
2121
};
2222

23-
export const responsiveForm = (DesktopComponent) => (props) =>
24-
(
25-
<ResponsiveForm>
26-
<DesktopComponent {...props} />
27-
</ResponsiveForm>
28-
);
23+
export const responsiveForm = (DesktopComponent) => (props) => (
24+
<ResponsiveForm>
25+
<DesktopComponent {...props} />
26+
</ResponsiveForm>
27+
);

server/controllers/embed.controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export function serveProject(req, res) {
1919
}
2020
// TODO this does not parse html
2121
const { files } = project;
22-
const htmlFile = files.find((file) =>
23-
file.name.match(/\.html$/i)
24-
).content;
22+
const htmlFile = files.find((file) => file.name.match(/\.html$/i))
23+
.content;
2524
const filesToInject = files.filter((file) =>
2625
file.name.match(/\.(js|css)$/i)
2726
);

server/controllers/project.controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,8 @@ function addFileToZip(file, files, zip, path = '') {
219219
return new Promise((resolve, reject) => {
220220
if (file.fileType === 'folder') {
221221
const newPath = file.name === 'root' ? path : `${path}${file.name}/`;
222-
const numChildFiles = file.children.filter(
223-
(f) => f.fileType !== 'folder'
224-
).length;
222+
const numChildFiles = file.children.filter((f) => f.fileType !== 'folder')
223+
.length;
225224
let childrenAdded = 0;
226225
if (numChildFiles === 0) {
227226
zip.folder(file.name);

server/scripts/examples.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ mongoose.connection.on('error', () => {
2929
async function getCategories() {
3030
const categories = [];
3131
const options = {
32-
url: 'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/en',
32+
url:
33+
'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/en',
3334
method: 'GET',
3435
headers: {
3536
...headers,
@@ -221,7 +222,8 @@ async function addAssetsToProject(assets, response, project) {
221222

222223
async function createProjectsInP5user(projectsInAllCategories) {
223224
const options = {
224-
url: 'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/assets',
225+
url:
226+
'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/assets',
225227
method: 'GET',
226228
headers: {
227229
...headers,

server/utils/fileUtils.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,10 @@ export const MEDIA_FILE_QUOTED_REGEX = new RegExp(
6666

6767
export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
6868
// these are files that have to be linked to with a blob url
69-
export const PLAINTEXT_FILE_REGEX =
70-
/.+\.(json|txt|csv|vert|frag|tsv|xml|stl)$/i;
69+
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv|xml|stl)$/i;
7170
// these are files that users would want to edit as text (maybe svg should be here?)
72-
export const TEXT_FILE_REGEX =
73-
/.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl)$/i;
71+
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl)$/i;
7472
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;
7573
export const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/;
7674

77-
export const CREATE_FILE_REGEX =
78-
/.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl)$/i;
75+
export const CREATE_FILE_REGEX = /.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl)$/i;

0 commit comments

Comments
 (0)