Skip to content

Commit 0b836ad

Browse files
committed
chore: Prettier 추가
1 parent 1adb9a3 commit 0b836ad

11 files changed

Lines changed: 59 additions & 32 deletions

forge.config.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
1-
import type { ForgeConfig } from '@electron-forge/shared-types';
2-
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
3-
import { MakerZIP } from '@electron-forge/maker-zip';
4-
import { MakerDeb } from '@electron-forge/maker-deb';
5-
import { MakerRpm } from '@electron-forge/maker-rpm';
6-
import { VitePlugin } from '@electron-forge/plugin-vite';
1+
import type { ForgeConfig } from "@electron-forge/shared-types";
2+
import { MakerSquirrel } from "@electron-forge/maker-squirrel";
3+
import { MakerZIP } from "@electron-forge/maker-zip";
4+
import { MakerDeb } from "@electron-forge/maker-deb";
5+
import { MakerRpm } from "@electron-forge/maker-rpm";
6+
import { VitePlugin } from "@electron-forge/plugin-vite";
77

88
const config: ForgeConfig = {
99
packagerConfig: {},
1010
rebuildConfig: {},
11-
makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), new MakerDeb({})],
11+
makers: [
12+
new MakerSquirrel({}),
13+
new MakerZIP({}, ["darwin"]),
14+
new MakerRpm({}),
15+
new MakerDeb({}),
16+
],
1217
plugins: [
1318
new VitePlugin({
1419
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
1520
// If you are familiar with Vite configuration, it will look really familiar.
1621
build: [
1722
{
1823
// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
19-
entry: 'src/main.ts',
20-
config: 'vite.main.config.ts',
24+
entry: "src/main.ts",
25+
config: "vite.main.config.ts",
2126
},
2227
{
23-
entry: 'src/preload.ts',
24-
config: 'vite.preload.config.ts',
28+
entry: "src/preload.ts",
29+
config: "vite.preload.config.ts",
2530
},
2631
],
2732
renderer: [
2833
{
29-
name: 'main_window',
30-
config: 'vite.renderer.config.ts',
34+
name: "main_window",
35+
config: "vite.renderer.config.ts",
3136
},
3237
],
3338
}),

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="UTF-8" />
55
<title>Hello World!</title>
6-
76
</head>
87
<body>
98
<h1>💖 Hello World!</h1>
109
<p>Welcome to your Electron application.</p>
11-
<script type="module" src="/src/renderer.ts"></script>
10+
<script
11+
type="module"
12+
src="/src/renderer.ts"></script>
1213
</body>
1314
</html>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"electron": "27.0.1",
3131
"eslint": "^8.0.1",
3232
"eslint-plugin-import": "^2.25.0",
33+
"prettier": "^3.0.3",
3334
"ts-node": "^10.0.0",
3435
"typescript": "~4.5.4"
3536
},

prettier.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('prettier').Config} */
2+
const config = {
3+
trailingComma: "es5",
4+
tabWidth: 2,
5+
semi: true,
6+
singleQuote: false,
7+
bracketSameLine: true,
8+
singleAttributePerLine: true,
9+
};
10+
11+
module.exports = config;

src/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body {
2-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
2+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
33
Arial, sans-serif;
44
margin: auto;
55
max-width: 38rem;

src/main.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { app, BrowserWindow } from 'electron';
2-
import path from 'path';
1+
import { app, BrowserWindow } from "electron";
2+
import path from "path";
33

44
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
5-
if (require('electron-squirrel-startup')) {
5+
if (require("electron-squirrel-startup")) {
66
app.quit();
77
}
88

@@ -12,15 +12,17 @@ const createWindow = () => {
1212
width: 800,
1313
height: 600,
1414
webPreferences: {
15-
preload: path.join(__dirname, 'preload.js'),
15+
preload: path.join(__dirname, "preload.js"),
1616
},
1717
});
1818

1919
// and load the index.html of the app.
2020
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
2121
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
2222
} else {
23-
mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`));
23+
mainWindow.loadFile(
24+
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`)
25+
);
2426
}
2527

2628
// Open the DevTools.
@@ -30,18 +32,18 @@ const createWindow = () => {
3032
// This method will be called when Electron has finished
3133
// initialization and is ready to create browser windows.
3234
// Some APIs can only be used after this event occurs.
33-
app.on('ready', createWindow);
35+
app.on("ready", createWindow);
3436

3537
// Quit when all windows are closed, except on macOS. There, it's common
3638
// for applications and their menu bar to stay active until the user quits
3739
// explicitly with Cmd + Q.
38-
app.on('window-all-closed', () => {
39-
if (process.platform !== 'darwin') {
40+
app.on("window-all-closed", () => {
41+
if (process.platform !== "darwin") {
4042
app.quit();
4143
}
4244
});
4345

44-
app.on('activate', () => {
46+
app.on("activate", () => {
4547
// On OS X it's common to re-create a window in the app when the
4648
// dock icon is clicked and there are no other windows open.
4749
if (BrowserWindow.getAllWindows().length === 0) {

src/renderer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* ```
2727
*/
2828

29-
import './index.css';
29+
import "./index.css";
3030

31-
console.log('👋 This message is being logged by "renderer.ts", included via Vite');
31+
console.log(
32+
'👋 This message is being logged by "renderer.ts", included via Vite'
33+
);

vite.main.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { defineConfig } from 'vite';
1+
import { defineConfig } from "vite";
22

33
// https://vitejs.dev/config
44
export default defineConfig({
55
resolve: {
66
// Some libs that can run in both Web and Node.js, such as `axios`, we need to tell Vite to build them in Node.js.
77
browserField: false,
8-
mainFields: ['module', 'jsnext:main', 'jsnext'],
8+
mainFields: ["module", "jsnext:main", "jsnext"],
99
},
1010
});

vite.preload.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vite';
1+
import { defineConfig } from "vite";
22

33
// https://vitejs.dev/config
44
export default defineConfig({});

vite.renderer.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vite';
1+
import { defineConfig } from "vite";
22

33
// https://vitejs.dev/config
44
export default defineConfig({});

0 commit comments

Comments
 (0)