From 7314628b2a93b6b9b3fca9eba699db7662c65424 Mon Sep 17 00:00:00 2001 From: Ibrahim Ansari Date: Fri, 24 Nov 2023 22:35:53 +0530 Subject: [PATCH] Use TSConfig base, fix CI and lints, rename ui dir --- .eslintrc.js | 4 ++-- .github/workflows/go.yml | 1 + .prettierrc.js | 2 +- package.json | 3 ++- {ui => renderer}/dialog.tsx | 0 {ui => renderer}/index.tsx | 0 tsconfig.json | 18 +++--------------- yarn.lock | 8 ++++++++ 8 files changed, 17 insertions(+), 19 deletions(-) rename {ui => renderer}/dialog.tsx (100%) rename {ui => renderer}/index.tsx (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 106897b..450f9fb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { root: true, env: { es2024: true, - browser: true + browser: true, }, extends: [ 'plugin:react/recommended', @@ -20,5 +20,5 @@ module.exports = { 'react/no-unknown-property': ['error', { ignore: ['css'] }], // Make TypeScript ESLint less strict. '@typescript-eslint/no-confusing-void-expression': 'off', - } + }, } diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0efa8a7..6349cbf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -44,6 +44,7 @@ jobs: - name: Get dependencies run: | + corepack enable yarn install --immutable go get -v -t -d ./... diff --git a/.prettierrc.js b/.prettierrc.js index a24d99a..359c550 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -4,4 +4,4 @@ module.exports = { singleQuote: true, semi: false, jsxSingleQuote: true, -}; +} diff --git a/package.json b/package.json index e3e8957..580fbb6 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "build:go:default": "go build -ldflags=\"-s -w\" -o writer -v", "build:go:windows": "go build -ldflags=\"-s -w -H windowsgui\" -o writer.exe -v", "build:launcher": "go build -tags launcher -ldflags=\"-s -w\" -o launcher.exe -v launcher_windows.go", - "build:js": "parcel build ui/index.tsx" + "build:js": "parcel build renderer/index.tsx" }, "packageManager": "yarn@4.0.2", "dependencies": { @@ -46,6 +46,7 @@ "devDependencies": { "@babel/core": "^7.23.3", "@emotion/babel-plugin": "^11.11.0", + "@tsconfig/vite-react": "^2.0.1", "@types/react": "^18.2.38", "@types/react-dom": "^18.2.17", "@typescript-eslint/eslint-plugin": "^6.12.0", diff --git a/ui/dialog.tsx b/renderer/dialog.tsx similarity index 100% rename from ui/dialog.tsx rename to renderer/dialog.tsx diff --git a/ui/index.tsx b/renderer/index.tsx similarity index 100% rename from ui/index.tsx rename to renderer/index.tsx diff --git a/tsconfig.json b/tsconfig.json index 2923c52..56fac8b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,7 @@ { + "extends": "@tsconfig/vite-react", "compilerOptions": { - "strict": true, - "skipLibCheck": true, - "isolatedModules": true, - "jsxImportSource": "@emotion/react", - "jsx": "react-jsx", - "lib": [ - "ES5", - "ES2015", - "ES2020.BigInt", - "DOM", - ], + "jsxImportSource": "@emotion/react" }, - "include": [ - "ui/**/*", - "ui/index.d.ts" - ], + "include": ["renderer/**/*", "renderer/index.d.ts"] } diff --git a/yarn.lock b/yarn.lock index 96ebf02..cd965d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2256,6 +2256,13 @@ __metadata: languageName: node linkType: hard +"@tsconfig/vite-react@npm:^2.0.1": + version: 2.0.1 + resolution: "@tsconfig/vite-react@npm:2.0.1" + checksum: 5715563bf293484c8b5ad36a0328159b11de9bde507b96dcde1d72243d02dcd8eb0383c1676e319cfb03e8f79d96891103d480c7157177f4d7a0b368ede4a46d + languageName: node + linkType: hard + "@types/json-schema@npm:^7.0.12": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" @@ -6824,6 +6831,7 @@ __metadata: "@emotion/styled": "npm:^11.11.0" "@mui/material": "npm:^5.14.18" "@swc/helpers": "npm:^0.5.3" + "@tsconfig/vite-react": "npm:^2.0.1" "@types/react": "npm:^18.2.38" "@types/react-dom": "npm:^18.2.17" "@typescript-eslint/eslint-plugin": "npm:^6.12.0"