mirror of
https://github.com/excalidraw/excalidraw-desktop.git
synced 2026-05-17 13:30:38 +00:00
Add Prettier, ESLint, Commit Hooks (#1)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": ["prettier"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019,
|
||||
"project": "./tsconfig.json",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"rules": {
|
||||
"curly": "error",
|
||||
"no-else-return": "error",
|
||||
"prettier/prettier": "error"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"bracketSpacing": false,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
@@ -6,14 +6,12 @@
|
||||
|
||||
## Develop
|
||||
|
||||
|
||||
### Install dependencies
|
||||
|
||||
```
|
||||
yarn
|
||||
```
|
||||
|
||||
|
||||
### Scripts
|
||||
|
||||
```
|
||||
|
||||
@@ -1,13 +1,41 @@
|
||||
{
|
||||
"description": "Excalidraw Desktop",
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "2.18.0",
|
||||
"@typescript-eslint/parser": "2.18.0",
|
||||
"electron": "7.1.10",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-config-prettier": "6.10.0",
|
||||
"eslint-plugin-prettier": "3.1.2",
|
||||
"husky": "4.2.1",
|
||||
"lint-staged": "10.0.4",
|
||||
"prettier": "1.19.1",
|
||||
"typescript": "3.7.5"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{json,md,yml}": [
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"name": "excalidraw-desktop",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"fix": "yarn fix:other && yarn fix:code",
|
||||
"fix:code": "yarn test:code --fix",
|
||||
"fix:other": "yarn prettier --write",
|
||||
"prettier": "prettier \"**/*.{json,md,yml}\"",
|
||||
"start": "yarn build && electron ./dist/main.js",
|
||||
"test": "yarn test:other && yarn test:code",
|
||||
"test:code": "eslint --ignore-path .gitignore --ext .ts,.tsx .",
|
||||
"test:other": "yarn prettier --list-different",
|
||||
"watch": "tsc -w"
|
||||
},
|
||||
"version": "0.0.1"
|
||||
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
import {app, BrowserWindow} from 'electron';
|
||||
import {app, BrowserWindow} from "electron";
|
||||
|
||||
let mainWindow: Electron.BrowserWindow;
|
||||
|
||||
@@ -8,22 +8,22 @@ function createWindow() {
|
||||
width: 800,
|
||||
});
|
||||
|
||||
mainWindow.loadURL('https://excalidraw.com');
|
||||
mainWindow.loadURL("https://excalidraw.com");
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow.on("closed", () => {
|
||||
mainWindow = null;
|
||||
});
|
||||
}
|
||||
|
||||
app.on('ready', createWindow);
|
||||
app.on("ready", createWindow);
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.on("window-all-closed", () => {
|
||||
if (process.platform !== "darwin") {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
app.on('activate', () => {
|
||||
app.on("activate", () => {
|
||||
if (mainWindow === null) {
|
||||
createWindow();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user