chore: added biome.json
This commit is contained in:
22
.github/workflows/biome.yaml
vendored
Normal file
22
.github/workflows/biome.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Biome Linter
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup Biome
|
||||
uses: biomejs/setup-biome@v2
|
||||
with:
|
||||
version: latest
|
||||
- name: Run Biome
|
||||
run: biome ci . --diagnostic-level=error
|
||||
34
biome.json
Normal file
34
biome.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
|
||||
"vcs": {
|
||||
"enabled": false,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab"
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
server/biome.json
Normal file
57
server/biome.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"root": false,
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"experimentalScannerIgnores": ["dist/**"],
|
||||
"includes": ["src/**/*.ts", "tests/**/*.ts"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab"
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noExportsInTest": "off",
|
||||
"noExplicitAny": "off",
|
||||
"noImplicitAnyLet": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"includes": ["tests/**"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUnreachable": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
36
shared/biome.json
Normal file
36
shared/biome.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"root": false,
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"experimentalScannerIgnores": ["dist", "drizzle", "archives"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab"
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
vite/biome.json
Normal file
36
vite/biome.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"root": false,
|
||||
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": false
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": false,
|
||||
"experimentalScannerIgnores": ["dist/**", "public/**"]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab"
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { format } from "date-fns";
|
||||
|
||||
type TimeCase = "upper" | "lower";
|
||||
export const formatDateStr = (date: Date | string) => {
|
||||
return format(new Date(date), "dd MMM yyyy");
|
||||
};
|
||||
@@ -22,10 +22,17 @@ export const formatUnixToDate = (
|
||||
}
|
||||
};
|
||||
|
||||
export const formatUnixToDateTime = (unix: number | null | undefined) => {
|
||||
export const formatUnixToDateTime = (unix: number | null | undefined,
|
||||
options?: { ampm?: boolean; case?: TimeCase }) => {
|
||||
if (!unix) return { date: "", time: "" };
|
||||
const date = format(new Date(unix), "d MMM");
|
||||
const time = format(new Date(unix), "HH:mm");
|
||||
|
||||
const pattern = options?.ampm ? "HH:mm a" : "HH:mm";
|
||||
let time = format(new Date(unix), pattern);
|
||||
|
||||
if (options?.case === "lower") time = time.toLowerCase();
|
||||
if (options?.case === "upper") time = time.toUpperCase();
|
||||
|
||||
return { date, time };
|
||||
};
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { X } from "lucide-react";
|
||||
import { useFeaturesQuery } from "@/hooks/queries/useFeaturesQuery";
|
||||
import { toast } from "sonner";
|
||||
|
||||
function CreditSystemConfig({
|
||||
creditSystem,
|
||||
@@ -74,6 +75,10 @@ function CreditSystemConfig({
|
||||
|
||||
const removeSchemaItem = (index: number) => {
|
||||
const newSchema = [...creditSystemConfig.schema];
|
||||
if (newSchema.length == 1) {
|
||||
toast.error("There must be at least one feature in the credit system");
|
||||
return;
|
||||
}
|
||||
newSchema.splice(index, 1);
|
||||
setCreditSystemConfig({ ...creditSystemConfig, schema: newSchema });
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ function CreateReward() {
|
||||
|
||||
const handleCreate = async () => {
|
||||
if (!reward?.id && !reward?.name) {
|
||||
toast.error("Reward ID and Name are required!");
|
||||
toast.error("ID and name are required");
|
||||
return;
|
||||
}
|
||||
setIsLoading(true);
|
||||
|
||||
Reference in New Issue
Block a user