Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add basic type-lint sanity checks on pull requests #1

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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