Skip to content

Commit

Permalink
feat: add basic type-lint sanity checks on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
hlolli committed Oct 27, 2023
1 parent 0ec25b8 commit 9d19013
Show file tree
Hide file tree
Showing 13 changed files with 2,474 additions and 110 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
app
42 changes: 42 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
settings: {
react: {
createClass: "createReactClass", // Regex for Component Factory to use,
pragma: "React", // Pragma to use, default to "React"
fragment: "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
version: "detect", // React version. "detect" automatically picks the version you have installed.
},
},
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {
"linebreak-style": ["error", "unix"],
"react/no-unknown-property": ["off"],
"react/react-in-jsx-scope": ["off"],
},
};
18 changes: 18 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Check Pull Request"
on:
pull_request:
branches: ["**"]
push:
branches:
- master
jobs:
check_pr:
runs-on: ubuntu-latest
strategy:
matrix:
step: ["check:lint", "check:types"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: ${{ matrix.step }}
run: npm install && npm run ${{ matrix.step }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ app
dist
*~
*#
.DS_Store
.DS_Store
*.tsbuildinfo
4 changes: 2 additions & 2 deletions main/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ app.on("window-all-closed", () => {
app.quit();
});

ipcMain.on("message", async (event: any, arg: any) => {
ipcMain.on("message", async (event, arg) => {
event.reply("message", `${arg} World!`);
});

ipcMain.on("open-url", async (event: any, arg: any) => {
ipcMain.on("open-url", async (event, arg) => {
shell.openExternal(arg);
});
2 changes: 0 additions & 2 deletions main/helpers/create-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
} from "electron";
import Store from "electron-store";

const platform = os.platform();

export const createWindow = (
windowName: string,
options: BrowserWindowConstructorOptions,
Expand Down
Loading

0 comments on commit 9d19013

Please sign in to comment.