Add Prettier, ESLint, Commit Hooks (#1)

This commit is contained in:
Lipis
2020-01-29 19:52:12 +02:00
committed by GitHub
parent bd79ac3265
commit 1f15e5a97c
6 changed files with 1606 additions and 17 deletions
+20
View File
@@ -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"
}
}
+4
View File
@@ -0,0 +1,4 @@
{
"bracketSpacing": false,
"trailingComma": "all"
}
-2
View File
@@ -6,14 +6,12 @@
## Develop
### Install dependencies
```
yarn
```
### Scripts
```
+28
View File
@@ -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
View File
@@ -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();
}
+1547 -8
View File
File diff suppressed because it is too large Load Diff