This commit is contained in:
Alie 2024-04-27 18:17:56 +02:00
parent 0c1de423ef
commit 42ca60c026
8 changed files with 57 additions and 50 deletions

View File

@ -2,17 +2,17 @@ module.exports = {
root: true, root: true,
env: { browser: true, es2020: true }, env: { browser: true, es2020: true },
extends: [ extends: [
'eslint:recommended', "eslint:recommended",
'plugin:@typescript-eslint/recommended', "plugin:@typescript-eslint/recommended",
'plugin:react-hooks/recommended', "plugin:react-hooks/recommended",
], ],
ignorePatterns: ['dist', '.eslintrc.cjs'], ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: '@typescript-eslint/parser', parser: "@typescript-eslint/parser",
plugins: ['react-refresh'], plugins: ["react-refresh"],
rules: { rules: {
'react-refresh/only-export-components': [ "react-refresh/only-export-components": [
'warn', "warn",
{ allowConstantExport: true }, { allowConstantExport: true },
], ],
}, },
} };

View File

@ -1,13 +1,20 @@
<!doctype html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> rel="icon"
type="image/svg+xml"
href="/vite.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title> <title>Vite + React + TS</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script> <script
type="module"
src="/src/main.tsx"></script>
</body> </body>
</html> </html>

View File

@ -1,10 +1,10 @@
db = new Mongo().getDB("bot"); db = new Mongo().getDB("bot");
db.createCollection('authorizations'); db.createCollection("authorizations");
db.authorizations.insert([ db.authorizations.insert([
{ {
app: "tester", app: "tester",
secret: "test" secret: "test",
} },
]) ]);

View File

@ -4,5 +4,5 @@ export interface ButtonProps {
} }
export default function ImageViewer(props: ButtonProps) { export default function ImageViewer(props: ButtonProps) {
return <button onClick={props.action}>{props.label}</button> return <button onClick={props.action}>{props.label}</button>;
} }

View File

@ -1,7 +1,5 @@
import ReactDOM from 'react-dom/client' import ReactDOM from "react-dom/client";
import App from './App.tsx' import App from "./App.tsx";
import './index.css' import "./index.css";
ReactDOM.createRoot(document.getElementById('root')!).render( ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
<App />
)

View File

@ -1,12 +1,14 @@
import React from "react"; import React from "react";
import { render, screen } from "@testing-library/react"; import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "bun:test"; import { describe, expect, it } from "bun:test";
import ImageModerator, { ImageModeratorProps } from '../../src/components/ImageModerator/ImageModerator'; import ImageModerator, {
ImageModeratorProps,
} from "../../src/components/ImageModerator/ImageModerator";
const properties: ImageModeratorProps = { const properties: ImageModeratorProps = {
acceptLabel: "Accept", acceptLabel: "Accept",
discardLabel: "Discard" discardLabel: "Discard",
} };
it("should render into the document", () => { it("should render into the document", () => {
render(<ImageModerator {...properties} />); render(<ImageModerator {...properties} />);

View File

@ -1,7 +1,7 @@
import { defineConfig } from 'vite' import { defineConfig } from "vite";
import react from '@vitejs/plugin-react-swc' import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()] plugins: [react()],
}) });