Skip to content

Commit bada862

Browse files
authored
Merge pull request #62 from increments/dependabot/npm_and_yarn/prettier-3.0.3
Bump prettier from 2.8.4 to 3.0.3
2 parents 9cc5892 + df5ada7 commit bada862

39 files changed

+134
-127
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"jest": "^29.4.3",
4343
"lint-staged": "^13.2.3",
4444
"npm-run-all": "^4.1.5",
45-
"prettier": "^2.8.4",
45+
"prettier": "^3.0.3",
4646
"react": "^18.2.0",
4747
"react-dom": "^18.2.0",
4848
"react-router-dom": "^6.8.1",

src/client/components/ArticleInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const ArticleInfo = ({
3232
isOlderThanRemote,
3333
}: Props) => {
3434
const [isOpen, setIsOpen] = useState(
35-
localStorage.getItem("openInfoState") === "true" ? true : false
35+
localStorage.getItem("openInfoState") === "true" ? true : false,
3636
);
3737

3838
const toggleAccordion = (event: React.MouseEvent<HTMLInputElement>) => {

src/client/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const Header = ({
3737
if (isOlderThanRemote) {
3838
if (
3939
!window.confirm(
40-
"この記事はQiita上の記事より古い可能性があります。上書きしますか?"
40+
"この記事はQiita上の記事より古い可能性があります。上書きしますか?",
4141
)
4242
) {
4343
return;

src/client/components/HotReloadRoot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const HotReloadRoot = ({ children }: Props) => {
3535

3636
export const useHotReloadEffect = (
3737
callback: () => unknown,
38-
deps: unknown[]
38+
deps: unknown[],
3939
) => {
4040
const { reloadedAt } = useContext(HotReloadContext);
4141

src/client/components/SidebarArticles.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const SidebarArticles = ({ items, sortType, articleState }: Props) => {
4747
};
4848

4949
const [isDetailsOpen, setIsDetailsOpen] = useState(
50-
localStorage.getItem(StorageName[articleState]) === "true"
50+
localStorage.getItem(StorageName[articleState]) === "true",
5151
);
5252

5353
const toggleAccordion = (event: React.MouseEvent<HTMLInputElement>) => {
@@ -138,7 +138,7 @@ const articlesListItemStyle = css({
138138
gap: getSpace(1),
139139
lineHeight: LineHeight.bodyDense,
140140
padding: `${getSpace(3 / 4)}px ${getSpace(5 / 2)}px ${getSpace(
141-
3 / 4
141+
3 / 4,
142142
)}px ${getSpace(3 / 2)}px`,
143143
whiteSpace: "nowrap",
144144
textOverflow: "ellipsis",

src/client/components/SidebarContents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type SortType = (typeof SortType)[keyof typeof SortType];
2828
export const SidebarContents = ({ isStateOpen, handleMobileClose }: Props) => {
2929
const [items, setItems] = useState<ItemsIndexViewModel>();
3030
const [isOpen, setIsOpen] = useState(
31-
localStorage.getItem("openSidebarState") === "true"
31+
localStorage.getItem("openSidebarState") === "true",
3232
);
3333

3434
const [sortType, setSortType] = useState<SortType>(SortType.ByUpdatedAt);
@@ -646,7 +646,7 @@ const articlesListItemStyle = css({
646646
gap: getSpace(1),
647647
lineHeight: LineHeight.bodyDense,
648648
padding: `${getSpace(3 / 4)}px ${getSpace(5 / 2)}px ${getSpace(
649-
3 / 4
649+
3 / 4,
650650
)}px ${getSpace(3 / 2)}px`,
651651
whiteSpace: "nowrap",
652652
textOverflow: "ellipsis",

src/client/components/Slide/SlideViewerContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const SlideViewerContent = ({
3838
onPrevious();
3939
}
4040
},
41-
[onPrevious, onNext]
41+
[onPrevious, onNext],
4242
);
4343

4444
return (

src/client/components/Slide/SlideViewerDashboard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ export const SlideViewerDashboard = ({
5050
onMouseMove={(event) => {
5151
setIsTooltipVisible(true);
5252
setTooltipLeftDistance(
53-
event.clientX - event.currentTarget.getBoundingClientRect().left
53+
event.clientX - event.currentTarget.getBoundingClientRect().left,
5454
);
5555
setDestinationPage(
56-
getMagnitudeFromRange(event.currentTarget, event.clientX, totalPage)
56+
getMagnitudeFromRange(
57+
event.currentTarget,
58+
event.clientX,
59+
totalPage,
60+
),
5761
);
5862
}}
5963
onMouseLeave={() => {

src/client/components/Slide/SlideViewerDashboardNavigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const SlideViewerDashboardNavigation = ({
2525
"slideMode-Dashboard_button--prev",
2626
{
2727
"slideMode-Dashboard_button--clickable": !disablePrevious,
28-
}
28+
},
2929
)}
3030
disabled={disablePrevious}
3131
onClick={() => onPrevious()}
@@ -41,7 +41,7 @@ export const SlideViewerDashboardNavigation = ({
4141
"slideMode-Dashboard_button--next",
4242
{
4343
"slideMode-Dashboard_button--clickable": !disableNext,
44-
}
44+
},
4545
)}
4646
disabled={disableNext}
4747
onClick={() => onNext()}

src/client/components/Slide/get-magnitude-from-range.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function getMagnitudeFromRange(
22
target: Element,
33
x: number,
4-
length: number
4+
length: number,
55
) {
66
const rect = target.getBoundingClientRect();
77
return Math.ceil((x - rect.left) / (rect.width / length));

src/client/components/Slide/slide-pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const slidePages = (article: {
66
body: string;
77
}): string[] => [
88
`<h1>${escape(
9-
article.title
9+
article.title,
1010
)}</h1><div class="slideMode-Viewer_content--firstSlideAuthor">by ${
1111
article.author.urlName
1212
}</div>`,

src/client/components/Snackbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const Snackbar = ({ message, setMessage }: Props) => {
4949

5050
const snackbarStyle = (
5151
isMessageExists: boolean,
52-
isMessageTypeSuccess: boolean
52+
isMessageTypeSuccess: boolean,
5353
) =>
5454
css({
5555
alignItems: "center",

src/client/components/Tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const Tooltip = ({
3737
handleHide();
3838
}
3939
},
40-
[isShow, handleHide]
40+
[isShow, handleHide],
4141
);
4242

4343
useEffect(() => {
@@ -77,7 +77,7 @@ const toolTipItemStyle = (
7777
isShow: boolean,
7878
horizontal: string,
7979
vertical: string,
80-
offset: number
80+
offset: number,
8181
) =>
8282
css({
8383
visibility: isShow ? "visible" : "hidden",

src/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="ja">
33
<head>
44
<meta charset="UTF-8" />

src/client/lib/entries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const entries = <T extends {}>(o: T) => {
55

66
// Wrapped Object.fromEntries with strict type
77
export const fromEntries = <K extends PropertyKey, V>(
8-
e: Iterable<readonly [K, V]>
8+
e: Iterable<readonly [K, V]>,
99
) => {
1010
return Object.fromEntries(e) as { [key in K]: V };
1111
};

src/client/lib/mixins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export const breakpoint = {
2424
XXL: 2559,
2525
} as const;
2626
export const viewport = fromEntries(
27-
entries(breakpoint).map(([k, v]) => [k, viewportMaker(v)])
27+
entries(breakpoint).map(([k, v]) => [k, viewportMaker(v)]),
2828
);

src/client/lib/window-size.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const useWindowSize = () => {
1111
}, [isClient]);
1212

1313
const [windowDimensions, setWindowDimensions] = useState(
14-
getWindowDimensions()
14+
getWindowDimensions(),
1515
);
1616
useEffect(() => {
1717
const onResize = () => {

src/commands/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const rootDir = process.cwd();
3737
const workflowsDirectoryPath = path.join(rootDir, ".github/workflows");
3838
const publishWorkflowFilePath = path.join(
3939
workflowsDirectoryPath,
40-
"publish.yml"
40+
"publish.yml",
4141
);
4242

4343
const gitignoreFilePath = path.join(rootDir, ".gitignore");
@@ -62,7 +62,7 @@ export const init = async () => {
6262
const userConfigFileContent = JSON.stringify(
6363
await config.getUserConfig(),
6464
null,
65-
2
65+
2,
6666
);
6767
writeFile(userConfigFilePath, userConfigFileContent);
6868

src/commands/login.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const login = async () => {
1313
console.log(`
1414
以下のURLにアクセスしてトークンを発行してください。(「read_qiita」と「write_qiita」にチェックを入れてください)
1515
${chalk.bold(
16-
"https://qiita.com/settings/tokens/new?read_qiita=1&write_qiita=1&description=qiita-cli"
16+
"https://qiita.com/settings/tokens/new?read_qiita=1&write_qiita=1&description=qiita-cli",
1717
)}
1818
`);
1919
const token = await rl.question("発行したトークンを入力: ");

src/commands/publish.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const publish = async (argv: string[]) => {
1515
"--force": Boolean,
1616
"-f": "--force",
1717
},
18-
{ argv }
18+
{ argv },
1919
);
2020

2121
const qiitaApi = await getQiitaApiInstance();
@@ -44,27 +44,30 @@ export const publish = async (argv: string[]) => {
4444

4545
// Validate
4646
const enableForcePublish = args["--force"];
47-
const invalidItemMessages = targetItems.reduce((acc, item) => {
48-
const frontmatterErrors = checkFrontmatterType(item);
49-
if (frontmatterErrors.length > 0)
50-
return [...acc, { name: item.name, errors: frontmatterErrors }];
47+
const invalidItemMessages = targetItems.reduce(
48+
(acc, item) => {
49+
const frontmatterErrors = checkFrontmatterType(item);
50+
if (frontmatterErrors.length > 0)
51+
return [...acc, { name: item.name, errors: frontmatterErrors }];
5152

52-
const validationErrors = validateItem(item);
53-
if (validationErrors.length > 0)
54-
return [...acc, { name: item.name, errors: validationErrors }];
53+
const validationErrors = validateItem(item);
54+
if (validationErrors.length > 0)
55+
return [...acc, { name: item.name, errors: validationErrors }];
5556

56-
if (!enableForcePublish && item.isOlderThanRemote) {
57-
return [
58-
...acc,
59-
{
60-
name: item.name,
61-
errors: ["内容がQiita上の記事より古い可能性があります"],
62-
},
63-
];
64-
}
57+
if (!enableForcePublish && item.isOlderThanRemote) {
58+
return [
59+
...acc,
60+
{
61+
name: item.name,
62+
errors: ["内容がQiita上の記事より古い可能性があります"],
63+
},
64+
];
65+
}
6566

66-
return acc;
67-
}, [] as { name: string; errors: string[] }[]);
67+
return acc;
68+
},
69+
[] as { name: string; errors: string[] }[],
70+
);
6871
if (invalidItemMessages.length > 0) {
6972
const chalk = (await import("chalk")).default;
7073
invalidItemMessages.forEach((msg) => {

src/commands/pull.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const pull = async (argv: string[]) => {
99
"--force": Boolean,
1010
"-f": "--force",
1111
},
12-
{ argv }
12+
{ argv },
1313
);
1414

1515
const qiitaApi = await getQiitaApiInstance();

src/lib/check-frontmatter-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const checkId: CheckType = {
8080

8181
const getErrorMessages = (
8282
frontMatter: FrontMatter,
83-
checkTypes: CheckType[]
83+
checkTypes: CheckType[],
8484
): string[] => {
8585
return checkTypes.reduce((errorMessages: string[], checkType) => {
8686
if (!checkType.isValid(frontMatter)) {

src/lib/config.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("config", () => {
7575

7676
it("returns default path", () => {
7777
expect(config.getCredentialDir()).toEqual(
78-
"/home/test-user/.config/qiita-cli"
78+
"/home/test-user/.config/qiita-cli",
7979
);
8080
});
8181

@@ -88,7 +88,7 @@ describe("config", () => {
8888

8989
it("returns customized path", () => {
9090
expect(config.getCredentialDir()).toEqual(
91-
"/home/test-user/qiita-articles/my-credential"
91+
"/home/test-user/qiita-articles/my-credential",
9292
);
9393
});
9494
});
@@ -102,7 +102,7 @@ describe("config", () => {
102102

103103
it("returns default path", () => {
104104
expect(config.getItemsRootDir()).toEqual(
105-
"/home/test-user/qiita-articles"
105+
"/home/test-user/qiita-articles",
106106
);
107107
});
108108

@@ -115,7 +115,7 @@ describe("config", () => {
115115

116116
it("returns customized path", () => {
117117
expect(config.getItemsRootDir()).toEqual(
118-
"/home/test-user/qiita-articles/my-root"
118+
"/home/test-user/qiita-articles/my-root",
119119
);
120120
});
121121
});
@@ -130,7 +130,7 @@ describe("config", () => {
130130

131131
it("returns default path", () => {
132132
expect(config.getUserConfigDir()).toEqual(
133-
"/home/test-user/qiita-articles"
133+
"/home/test-user/qiita-articles",
134134
);
135135
});
136136

@@ -143,7 +143,7 @@ describe("config", () => {
143143

144144
it("returns customized path", () => {
145145
expect(config.getUserConfigDir()).toEqual(
146-
"/home/test-user/qiita-articles/my-root"
146+
"/home/test-user/qiita-articles/my-root",
147147
);
148148
});
149149
});
@@ -158,7 +158,7 @@ describe("config", () => {
158158

159159
it("returns default path", () => {
160160
expect(config.getUserConfigFilePath()).toEqual(
161-
"/home/test-user/qiita-articles/qiita.config.json"
161+
"/home/test-user/qiita-articles/qiita.config.json",
162162
);
163163
});
164164

@@ -171,7 +171,7 @@ describe("config", () => {
171171

172172
it("returns customized path", () => {
173173
expect(config.getUserConfigFilePath()).toEqual(
174-
"/home/test-user/qiita-articles/my-root/qiita.config.json"
174+
"/home/test-user/qiita-articles/my-root/qiita.config.json",
175175
);
176176
});
177177
});
@@ -185,7 +185,7 @@ describe("config", () => {
185185

186186
it("returns default path", () => {
187187
expect(config.getCacheDataDir()).toEqual(
188-
"/home/test-user/.cache/qiita-cli"
188+
"/home/test-user/.cache/qiita-cli",
189189
);
190190
});
191191

0 commit comments

Comments
 (0)