Skip to content

Commit

Permalink
feat(format) : Added eslint & prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximePremont committed Sep 9, 2024
1 parent 23caccf commit 821e952
Show file tree
Hide file tree
Showing 20 changed files with 3,957 additions and 321 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Indentation
indent_style = space
indent_size = 2
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.md
*.mdx
.next
node_modules
app
dist
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"root": false,
"parser": "@typescript-eslint/parser",
"extends": [
"next",
"next/core-web-vitals",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:tailwindcss/recommended",
"prettier"
],
"plugins": ["prettier", "@typescript-eslint", "tailwindcss"]
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.md
*.mdx
.next
node_modules
app
dist
21 changes: 21 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": true,
"endOfLine": "lf",
"embeddedLanguageFormatting": "auto",
"singleAttributePerLine": true,
"plugins": ["prettier-plugin-tailwindcss"]
}
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ linux:
- deb
- rpm
- snap
category: Utility
category: Utility
4 changes: 2 additions & 2 deletions main/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if (isProd) {
width: 1000,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
},
preload: path.join(__dirname, 'preload.js')
}
})

if (isProd) {
Expand Down
16 changes: 8 additions & 8 deletions main/helpers/create-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
screen,
BrowserWindow,
BrowserWindowConstructorOptions,
Rectangle,
Rectangle
} from 'electron'
import Store from 'electron-store'

Expand All @@ -15,7 +15,7 @@ export const createWindow = (
const store = new Store<Rectangle>({ name })
const defaultSize = {
width: options.width,
height: options.height,
height: options.height
}
let state = {}

Expand All @@ -28,7 +28,7 @@ export const createWindow = (
x: position[0],
y: position[1],
width: size[0],
height: size[1],
height: size[1]
}
}

Expand All @@ -45,12 +45,12 @@ export const createWindow = (
const bounds = screen.getPrimaryDisplay().bounds
return Object.assign({}, defaultSize, {
x: (bounds.width - defaultSize.width) / 2,
y: (bounds.height - defaultSize.height) / 2,
y: (bounds.height - defaultSize.height) / 2
})
}

const ensureVisibleOnSomeDisplay = (windowState) => {
const visible = screen.getAllDisplays().some((display) => {
const ensureVisibleOnSomeDisplay = windowState => {
const visible = screen.getAllDisplays().some(display => {
return windowWithinBounds(windowState, display.bounds)
})
if (!visible) {
Expand All @@ -76,8 +76,8 @@ export const createWindow = (
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
...options.webPreferences,
},
...options.webPreferences
}
})

win.on('close', saveState)
Expand Down
2 changes: 1 addition & 1 deletion main/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const handler = {
return () => {
ipcRenderer.removeListener(channel, subscription)
}
},
}
}

contextBridge.exposeInMainWorld('ipc', handler)
Expand Down
Loading

0 comments on commit 821e952

Please sign in to comment.