Skip to content

Commit

Permalink
Update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Sep 25, 2024
1 parent 39e29e2 commit 10a2a5c
Show file tree
Hide file tree
Showing 59 changed files with 52 additions and 97 deletions.
1 change: 0 additions & 1 deletion app/javascript/components/Attachments.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import useAttachments from "./Attachments/useAttachments";
import List from "./Attachments/List";
import * as Attachment from "../types/Attachments";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Attachments/Attachment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent } from "react";
import { MouseEvent } from "react";
import copyToClipboard from "../../lib/copyToClipboard";
import AttachmentEditor from "./AttachmentEditor";
import useModalStore from "../../stores/useModalStore";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Attachments/AttachmentEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, MouseEvent, useState } from "react";
import { ChangeEvent, MouseEvent, useState } from "react";
import copyToClipboard, { copySupported } from "../../lib/copyToClipboard";
import useModalStore from "../../stores/useModalStore";
import useToastStore from "../../stores/useToastStore";
Expand Down
1 change: 0 additions & 1 deletion app/javascript/components/Attachments/List.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import Attachment from "./Attachment";
import Placeholder from "./Placeholder";
import FileUploadButton from "../FileUploadButton";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/Attachments/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export default function Placeholder() {
return (
<div className="attachment drop-placeholder" key="file-placeholder">
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/DateRangeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useState } from "react";
import { useCallback, useEffect, useState } from "react";

import DateTimeSelect from "./DateTimeSelect";

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/DateTimeSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";

interface DateTimeSelectProps {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/EditableImage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent, useState } from "react";
import { MouseEvent, useState } from "react";

import useModalStore from "../stores/useModalStore";
import * as Images from "../types/Images";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/FileUploadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, MouseEvent, useRef } from "react";
import { ChangeEvent, MouseEvent, useRef } from "react";

interface Props {
callback: (files: File[]) => void;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageCropper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useState } from "react";
import { useCallback, useState } from "react";

import * as Crop from "../types/Crop";

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageCropper/FocalPoint.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent, TouchEvent, useRef, useState } from "react";
import { MouseEvent, TouchEvent, useRef, useState } from "react";

import * as Crop from "../../types/Crop";

Expand Down
1 change: 0 additions & 1 deletion app/javascript/components/ImageCropper/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import ReactCrop from "react-image-crop";

import * as Crop from "../../types/Crop";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageCropper/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent } from "react";
import { MouseEvent } from "react";

import * as Crop from "../../types/Crop";
import * as Images from "../../types/Images";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent, useState } from "react";
import { MouseEvent, useState } from "react";

import useModalStore from "../stores/useModalStore";
import { putJson } from "../lib/request";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageEditor/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent, MouseEvent } from "react";
import { ChangeEvent, MouseEvent } from "react";

import useModalStore from "../../stores/useModalStore";
import useToastStore from "../../stores/useToastStore";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/ImageGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as Images from "../types/Images";
import useImageGrid from "./ImageGrid/useImageGrid";
import Grid from "./ImageGrid/Grid";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageGrid/DragElement.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { RefObject } from "react";
import { RefObject } from "react";

import * as Drag from "../../types/Drag";
import * as Images from "../../types/Images";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/ImageGrid/FilePlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

export default function FilePlaceholder() {
return (
<div className="grid-image" key="file-placeholder">
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageGrid/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef } from "react";
import { useRef } from "react";
import FileUploadButton from "../FileUploadButton";
import DragElement from "./DragElement";
import FilePlaceholder from "./FilePlaceholder";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageGrid/GridImage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { MouseEvent, useEffect, useState } from "react";
import { MouseEvent, useEffect, useState } from "react";

import copyToClipboard from "../../lib/copyToClipboard";
import useToastStore from "../../stores/useToastStore";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/ImageGrid/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

interface Props {
src: string;
}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/ImageUploader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { DragEvent, MouseEvent, useState } from "react";
import { DragEvent, MouseEvent, useState } from "react";

import useToastStore from "../stores/useToastStore";
import { post } from "../lib/request";
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/LabelledField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import { Fragment } from "react";

interface LabelledFieldProps {
label: string;
Expand All @@ -21,10 +21,10 @@ export default function LabelledField(props: LabelledFieldProps) {
<label htmlFor={htmlFor}>
{label}
{errors && (
<React.Fragment>
<Fragment>
{" "}
<span className="error">{errors[errors.length - 1]}</span>
</React.Fragment>
</Fragment>
)}
</label>
{description && <p className="description">{description}</p>}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, MouseEvent, useEffect } from "react";
import { useCallback, MouseEvent, useEffect } from "react";

import useModalStore from "../stores/useModalStore";

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/PageForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from "react";
import { useEffect } from "react";

import { putJson, postJson } from "../lib/request";
import useToastStore from "../stores/useToastStore";
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/PageForm/Block.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent } from "react";
import { ChangeEvent } from "react";

import * as Template from "../../types/Template";

Expand Down
7 changes: 3 additions & 4 deletions app/javascript/components/PageForm/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";

import { Fragment } from "react";
import * as PageEditor from "../../types/PageEditor";
import * as Tags from "../../types/Tags";
import { MaybeLocalizedValue } from "../../types";
Expand Down Expand Up @@ -27,7 +26,7 @@ export default function Content(props: Props) {
};

return (
<React.Fragment>
<Fragment>
{templateConfig.blocks.map((b) => (
<Block
key={b.name}
Expand All @@ -49,6 +48,6 @@ export default function Content(props: Props) {
/>
</LabelledField>
)}
</React.Fragment>
</Fragment>
);
}
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/Dates.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as PageEditor from "../../types/PageEditor";

import DateRangeSelect from "../DateRangeSelect";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/Files.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as Attachments from "../../types/Attachments";
import { Locale } from "../../types";

Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import { csrfToken } from "../../lib/request";
import * as PageEditor from "../../types/PageEditor";

Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/Images.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import { GridState } from "../../types/Images";
import { Locale } from "../../types";

Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/LocaleLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as PageEditor from "../../types/PageEditor";

interface Props {
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/PageForm/Metadata.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import { Fragment } from "react";

import * as PageEditor from "../../types/PageEditor";
import * as Pages from "../../types/Pages";
Expand Down Expand Up @@ -29,7 +29,7 @@ export default function Metadata(props: Props) {
};

return (
<React.Fragment>
<Fragment>
<PathSegment state={state} dispatch={dispatch} />
<LabelledField
htmlFor="page_meta_image_id"
Expand Down Expand Up @@ -62,6 +62,6 @@ export default function Metadata(props: Props) {
value={blockValue(state, b)}
/>
))}
</React.Fragment>
</Fragment>
);
}
6 changes: 3 additions & 3 deletions app/javascript/components/PageForm/Options.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, ChangeEvent } from "react";
import { Fragment, useState, ChangeEvent } from "react";

import * as PageEditor from "../../types/PageEditor";
import * as Pages from "../../types/Pages";
Expand Down Expand Up @@ -127,7 +127,7 @@ export default function Options(props: OptionsProps) {
</a>
</p>
{showAdvanced && (
<React.Fragment>
<Fragment>
<LabelledField label="Subpages">
<label className="check-box">
<input
Expand Down Expand Up @@ -187,7 +187,7 @@ export default function Options(props: OptionsProps) {
onChange={handleChange("redirect_to")}
/>
</LabelledField>
</React.Fragment>
</Fragment>
)}
{url && (
<LabelledField label="Page link">
Expand Down
7 changes: 3 additions & 4 deletions app/javascript/components/PageForm/PageDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";

import { Fragment } from "react";
import * as PageEditor from "../../types/PageEditor";
import * as Pages from "../../types/Pages";

Expand Down Expand Up @@ -35,10 +34,10 @@ export default function PageDescription(props: PageDescriptionProps) {
<LocaleLinks state={state} dispatch={dispatch} />
<h3>
{page.ancestors.map((p) => (
<React.Fragment key={p.id}>
<Fragment key={p.id}>
{editLink(locale, p)}
{" » "}
</React.Fragment>
</Fragment>
))}
{page.id ? editLink(locale, page) : "New Page"}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/PageForm/PathSegment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ChangeEvent } from "react";
import { ChangeEvent } from "react";

import * as PageEditor from "../../types/PageEditor";
import * as Pages from "../../types/Pages";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/TabPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

interface TabPanelProps {
active: boolean;
children: React.ReactNode;
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageForm/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as PageEditor from "../../types/PageEditor";

interface Props {
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/components/PageForm/UnconfiguredContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import { Fragment } from "react";

import * as PageEditor from "../../types/PageEditor";
import { MaybeLocalizedValue } from "../../types";
Expand All @@ -21,7 +21,7 @@ export default function UnconfiguredContent(props: Props) {
};

return (
<React.Fragment>
<Fragment>
<p>
This page has additional content fields not enabled by the selected
template.
Expand All @@ -37,6 +37,6 @@ export default function UnconfiguredContent(props: Props) {
value={blockValue(state, b)}
/>
))}
</React.Fragment>
</Fragment>
);
}
2 changes: 0 additions & 2 deletions app/javascript/components/PageImages.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as Images from "../types/Images";
import { Locale } from "../types";

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/PageTree.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useState } from "react";
import { useCallback, useEffect, useState } from "react";

import * as Pages from "../types/Pages";
import * as Tree from "./PageTree/tree";
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageTree/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

type Props = {
label: string;
icon: string;
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageTree/CollapseArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as Tree from "./tree";
import { State, Action, visibleChildNodes } from "./usePageTree";

Expand Down
2 changes: 0 additions & 2 deletions app/javascript/components/PageTree/CollapsedLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

import * as Tree from "./tree";
import { State, visibleChildNodes } from "./usePageTree";

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/PageTree/EditPageName.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";

import * as Tree from "./tree";
import { State, Action, updatePage } from "./usePageTree";
Expand Down
Loading

0 comments on commit 10a2a5c

Please sign in to comment.