Skip to content

Commit

Permalink
fix TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
binarykitchen committed Oct 22, 2024
1 parent 66a1daa commit 1e415c4
Show file tree
Hide file tree
Showing 69 changed files with 7,696 additions and 7,470 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ jobs:
- name: 🔎 Run prettier
run: npm run prettier

# TODO Restore later
# - name: 🔎 Run linter
# run: npm run lint
- name: 🔎 Run linter
run: npm run lint

# TODO Enable once implemented
# - name: 🔎 Check types
# run: npm run types-check
- name: 🔎 Check types
run: npm run types:check

- name: 🔨 Build
run: npm run build:prod
Expand Down
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.useFlatConfig": true,
"eslint.options": {
"overrideConfigFile": "./.eslintrc.js"
"overrideConfigFile": "./eslint.config.mjs"
},
"prettier.configPath": "./prettier.config.cjs",
"stylelint.validate": ["stylus"],
Expand All @@ -23,16 +24,20 @@
"filesize",
"getusermedia",
"hyperscript",
"keymirror",
"ICPU",
"initialise",
"KHTML",
"Mbit",
"mofo",
"MSIE",
"nanoevents",
"Ooops",
"packagejson",
"Pivac",
"playsinline",
"plusplus",
"preend",
"prefinish",
"rsbuild",
"rubberband",
"Sadler",
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Looking at the examples in the `/src/stories` folder should give you some ideas
- <a href="#replay">`videomailClient.replay()`</a>
- <a href="#startOver">`videomailClient.startOver()`</a>
- <a href="#get">`videomailClient.get()`</a>
- <a href="#canRecord">`videomailClient.canRecord()`</a>
- <a href="#unload">`videomailClient.unload()`</a>
- <a href="#hide">`videomailClient.hide()`</a>
- <a href="#isDirty">`videomailClient.isDirty()`</a>
Expand Down Expand Up @@ -155,12 +154,6 @@ Queries a videomail (JSON) by a given alias for further queries or processing. T
1. The form submission to your own server has it under `videomail_alias` in the form body.
2. Get the alias from the `submitted` event and use it further within your code.

<a name="canRecord"></a>

### videomailClient.canRecord()

An utility function which returns true if the current browser is capable of webcam recording. It returns false for <a href="#compatibility">incompatible</a> browsers.

<a name="unload"></a>

### videomailClient.unload()
Expand Down
12 changes: 5 additions & 7 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,23 @@ import * as regexpPlugin from "eslint-plugin-regexp";
import pluginSecurity from "eslint-plugin-security";
import globals from "globals";
import tseslint from "typescript-eslint";
// TODO Enable once this is merged https://github.com/storybookjs/eslint-plugin-storybook/pull/156
// import storybook from "eslint-plugin-storybook";
import storybook from "eslint-plugin-storybook";

// Good reference: https://github.com/dustinspecker/awesome-eslint#readme

export default tseslint.config(
// TODO change to .all later
eslint.configs.recommended,
eslint.configs.all,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// ...storybook.configs["flat/recommended"],
...storybook.configs["flat/recommended"],
eslintPluginImportX.flatConfigs.recommended,
eslintPluginImportX.flatConfigs.typescript,
pluginSecurity.configs.recommended,
regexpPlugin.configs["flat/all"],
pluginPromise.configs["flat/recommended"],
depend.configs["flat/recommended"],
{
ignores: [".github", ".vscode", "**/node_modules/", ".git", "test"],
ignores: [".github", ".vscode", "**/node_modules/", ".git", "test", "dist"],
name: "Ignore files",
},
{
Expand Down Expand Up @@ -109,6 +107,7 @@ export default tseslint.config(
"max-lines-per-function": "off",
"max-params": "off",
"max-statements": "off",
"new-cap": "off",
"no-alert": "off",
"no-console": "off",
"no-debugger": "warn",
Expand All @@ -124,7 +123,6 @@ export default tseslint.config(
"no-shadow": "off",
"no-ternary": "off",
"no-undefined": "off",

"no-use-before-define": "off",
"no-void": "off",
"no-warning-comments": "off",
Expand Down
16 changes: 7 additions & 9 deletions etc/rsbuild/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from "@rsbuild/core";
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill";
import { pluginStylus } from "@rsbuild/plugin-stylus";
// import { pluginDts } from "rsbuild-plugin-dts";
import { pluginDts } from "rsbuild-plugin-dts";

import { tsEntry } from "./paths";
import { tsConfigProd, tsEntry } from "./paths";
import { NodeEnvType } from "../../src/types/env";
import isProductionMode from "../../src/util/isProductionMode";

Expand All @@ -14,19 +14,17 @@ export default defineConfig({
filenameHash: false,
injectStyles: true,
legalComments: "none",
distPath: {
js: "",
},
},
source: {
entry: {
index: tsEntry,
},
tsconfigPath: tsConfigProd,
},
plugins: [
pluginStylus(),
pluginNodePolyfill(),
// Inspired by https://github.com/web-infra-dev/rslib/blob/main/packages/core/src/config.ts#L742
// It's still in early stages
// pluginDts({}),
],
plugins: [pluginStylus(), pluginNodePolyfill(), pluginDts({})],
tools: {
htmlPlugin: false,
},
Expand Down
3 changes: 2 additions & 1 deletion etc/rsbuild/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const rootDir = fs.realpathSync(process.cwd());
const resolvePath = (relativePath: string) => path.resolve(rootDir, relativePath);

const srcDir = resolvePath("src");
const tsConfigProd = resolvePath("tsconfig.prod.json");
const tsEntry = resolvePath(path.join(srcDir, "index.ts"));

export { tsEntry };
export { tsEntry, tsConfigProd };
Loading

0 comments on commit 1e415c4

Please sign in to comment.