🐛 fix(types): Checking

This commit is contained in:
web@ppanel
2024-11-26 19:21:37 +07:00
parent c7e50a9b84
commit 2992824353
34 changed files with 2085 additions and 3150 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
"private": true,
"main": "index.js",
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"commitlint": "^19.5.0",
"@commitlint/cli": "^19.6.0",
"commitlint": "^19.6.0",
"commitlint-config-gitmoji": "^2.3.1"
}
}
+32
View File
@@ -0,0 +1,32 @@
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import onlyWarn from 'eslint-plugin-only-warn';
import turboPlugin from 'eslint-plugin-turbo';
import tseslint from 'typescript-eslint';
/**
* A shared ESLint configuration for the repository.
*
* @type {import("eslint").Linter.Config}
* */
export const config = [
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
plugins: {
turbo: turboPlugin,
},
rules: {
'turbo/no-undeclared-env-vars': 'warn',
},
},
{
plugins: {
onlyWarn,
},
},
{
ignores: ['dist/**'],
},
];
-34
View File
@@ -1,34 +0,0 @@
const { resolve } = require('node:path');
const project = resolve(process.cwd(), 'tsconfig.json');
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['eslint:recommended', 'prettier', 'turbo'],
plugins: ['only-warn'],
globals: {
React: true,
JSX: true,
},
env: {
node: true,
},
settings: {
'import/resolver': {
typescript: {
project,
},
},
},
ignorePatterns: [
// Ignore dotfiles
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
{
files: ['*.js?(x)', '*.ts?(x)'],
},
],
};
+45 -32
View File
@@ -1,36 +1,49 @@
const { resolve } = require('node:path');
import js from '@eslint/js';
import pluginNext from '@next/eslint-plugin-next';
import eslintConfigPrettier from 'eslint-config-prettier';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import { config as baseConfig } from './base.js';
const project = resolve(process.cwd(), 'tsconfig.json');
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
require.resolve('@vercel/style-guide/eslint/next'),
'turbo',
],
globals: {
React: true,
JSX: true,
},
env: {
node: true,
browser: true,
},
plugins: ['only-warn'],
settings: {
'import/resolver': {
typescript: {
project,
/**
* A custom ESLint configuration for libraries that use Next.js.
*
* @type {import("eslint").Linter.Config}
* */
export const nextJsConfig = [
...baseConfig,
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
...pluginReact.configs.flat.recommended,
languageOptions: {
...pluginReact.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
},
},
},
ignorePatterns: [
// Ignore dotfiles
'.*.js',
'node_modules/',
],
overrides: [{ files: ['*.js?(x)', '*.ts?(x)'] }],
};
{
plugins: {
'@next/next': pluginNext,
},
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
},
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
settings: { react: { version: 'detect' } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
'react/react-in-jsx-scope': 'off',
},
},
];
+16 -13
View File
@@ -1,21 +1,24 @@
{
"name": "@repo/eslint-config",
"private": true,
"files": [
"library.js",
"next.js",
"react-internal.js"
],
"type": "module",
"exports": {
"./base": "./base.js",
"./next-js": "./next.js",
"./react-internal": "./react-internal.js"
},
"devDependencies": {
"@next/eslint-plugin-next": "^15.0.3",
"@types/eslint": "^8",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@vercel/style-guide": "^6.0.0",
"eslint": "^8",
"eslint-config-next": "^15.0.3",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^2.2.3",
"eslint-plugin-only-warn": "^1.1.0"
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-turbo": "^2.3.2",
"globals": "^15.12.0",
"typescript": "^5.7.2",
"typescript-eslint": "^8.16.0"
}
}
+35 -35
View File
@@ -1,39 +1,39 @@
const { resolve } = require('node:path');
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import { config as baseConfig } from './base.js';
const project = resolve(process.cwd(), 'tsconfig.json');
/*
* This is a custom ESLint configuration for use with
* internal (bundled by their consumer) libraries
* that utilize React.
*/
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ['eslint:recommended', 'prettier', 'turbo'],
plugins: ['only-warn'],
globals: {
React: true,
JSX: true,
},
env: {
browser: true,
},
settings: {
'import/resolver': {
typescript: {
project,
/**
* A custom ESLint configuration for libraries that use React.
*
* @type {import("eslint").Linter.Config} */
export const config = [
...baseConfig,
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
languageOptions: {
...pluginReact.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
...globals.browser,
},
},
},
ignorePatterns: [
// Ignore dotfiles
'.*.js',
'node_modules/',
'dist/',
],
overrides: [
// Force ESLint to detect .tsx files
{ files: ['*.js?(x)', '*.ts?(x)'] },
],
};
{
plugins: {
'react-hooks': pluginReactHooks,
},
settings: { react: { version: 'detect' } },
rules: {
...pluginReactHooks.configs.recommended.rules,
// React scope no longer necessary with new JSX transform.
'react/react-in-jsx-scope': 'off',
},
},
];
+3 -3
View File
@@ -4,12 +4,12 @@
"main": "index.js",
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
"prettier": "^3.3.3",
"prettier": "^3.4.0",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-packagejson": "^2.5.3",
"prettier-plugin-packagejson": "^2.5.6",
"prettier-plugin-sh": "^0.14.0",
"prettier-plugin-sort-json": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.6.8",
"prettier-plugin-tailwindcss": "^0.6.9",
"prettier-plugin-two-style-order": "^1.0.1"
}
}
-18
View File
@@ -1,18 +0,0 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@repo/eslint-config/react-internal.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.lint.json',
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-redeclare': 'off',
'no-unused-vars': 'off',
'no-undef': 'off',
},
};
+23
View File
@@ -0,0 +1,23 @@
import { config } from '@repo/eslint-config/react-internal';
/** @type {import("eslint").Linter.Config} */
export default [
...config,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react/prop-types': 'off',
'react/no-unknown-property': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/jsx-no-target-blank': 'off',
'prefer-const': 'off',
'no-var': 'off',
'no-dupe-keys': 'off',
},
},
];
+14 -14
View File
@@ -26,7 +26,7 @@
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.2",
"@radix-ui/react-navigation-menu": "^1.2.1",
@@ -44,21 +44,21 @@
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4",
"@react-three/drei": "^9.116.0",
"@react-three/drei": "^9.117.3",
"@react-three/fiber": "^8.17.10",
"@tabler/icons-react": "^3.22.0",
"@tsparticles/engine": "^3.5.0",
"@tsparticles/engine": "^3.7.1",
"@tsparticles/react": "^3.0.0",
"@tsparticles/slim": "^3.5.0",
"class-variance-authority": "^0.7.0",
"@tsparticles/slim": "^3.7.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "1.0.4",
"cobe": "^0.6.3",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.3.1",
"framer-motion": "^11.11.16",
"embla-carousel-react": "^8.5.1",
"framer-motion": "^11.11.17",
"input-otp": "^1.4.1",
"lucide-react": "^0.456.0",
"lucide-react": "^0.461.0",
"mini-svg-data-uri": "^1.4.4",
"next-themes": "^0.4.3",
"qss": "^3.0.0",
@@ -66,21 +66,21 @@
"react-dropzone": "^14.3.5",
"react-hook-form": "^7.53.2",
"react-icons": "^5.3.0",
"react-resizable-panels": "^2.1.6",
"react-resizable-panels": "^2.1.7",
"recharts": "^2.13.3",
"simplex-noise": "^4.0.3",
"sonner": "^1.7.0",
"tailwind-merge": "^2.5.4",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"three": "^0.170.0",
"three-globe": "^2.34.4",
"three-globe": "^2.35.2",
"vaul": "^1.1.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^22.9.0",
"@types/node": "^22.10.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/three": "^0.170.0",
@@ -88,7 +88,7 @@
"next": "^15.0.3",
"postcss": "^8.4.49",
"react": "^18.3.1",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3"
"tailwindcss": "^3.4.15",
"typescript": "^5.7.2"
}
}
-8
View File
@@ -1,8 +0,0 @@
{
"compilerOptions": {
"outDir": "dist"
},
"exclude": ["node_modules", "dist"],
"extends": "@repo/typescript-config/react-library.json",
"include": ["src", "*.mjs", "*.ts"]
}
-13
View File
@@ -1,13 +0,0 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: ['@repo/eslint-config/react-internal.js'],
parser: '@typescript-eslint/parser',
// parserOptions: {
// project: './tsconfig.lint.json',
// },
rules: {
'no-redeclare': 'off',
'no-unused-vars': 'off',
},
};
+23
View File
@@ -0,0 +1,23 @@
import { config } from '@repo/eslint-config/react-internal';
/** @type {import("eslint").Linter.Config} */
export default [
...config,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react/prop-types': 'off',
'react/no-unknown-property': 'off',
'react-hooks/exhaustive-deps': 'off',
'react/jsx-no-target-blank': 'off',
'prefer-const': 'off',
'no-var': 'off',
'no-dupe-keys': 'off',
},
},
];
+8 -7
View File
@@ -16,15 +16,15 @@
},
"dependencies": {
"@monaco-editor/react": "^4.6.0",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-icons": "^1.3.2",
"@shadcn/ui": "workspace:*",
"@tanstack/react-table": "^8.20.5",
"@types/react-syntax-highlighter": "^15.5.13",
"ahooks": "^3.8.1",
"katex": "^0.16.11",
"lottie-react": "^2.4.0",
"lucide-react": "^0.456.0",
"mathjs": "^13.2.2",
"lucide-react": "^0.461.0",
"mathjs": "^14.0.0",
"react": "^18.3.1",
"react-markdown": "^9.0.1",
"react-syntax-highlighter": "^15.6.1",
@@ -37,14 +37,15 @@
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@turbo/gen": "^2.2.3",
"@types/node": "^22.9.0",
"@turbo/gen": "^2.3.2",
"@types/node": "^22.10.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"autoprefixer": "^10.4.20",
"next": "^15.0.3",
"postcss": "^8.4.49",
"react": "^18.3.1",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3"
"tailwindcss": "^3.4.15",
"typescript": "^5.7.2"
}
}
+3 -1
View File
@@ -1,11 +1,13 @@
'use client';
import Editor, { OnMount } from '@monaco-editor/react';
import { type OnMount } from '@monaco-editor/react';
import { Button } from '@shadcn/ui/button';
import { cn } from '@shadcn/ui/lib/utils';
import { useSize } from 'ahooks';
import { EyeIcon, EyeOff, FullscreenIcon, MinimizeIcon } from 'lucide-react';
import dynamic from 'next/dynamic';
import { useRef, useState } from 'react';
const Editor = dynamic(() => import('@monaco-editor/react'), { ssr: false });
export interface MonacoEditorProps {
value?: string;
+4 -1
View File
@@ -71,7 +71,10 @@ export function EnhancedInput({
};
return (
<div className={cn('border-input flex w-full items-center rounded-md border', className)}>
<div
className={cn('border-input flex w-full items-center rounded-md border', className)}
suppressHydrationWarning
>
{prefix && <div className='bg-muted mr-px flex h-9 items-center px-3'>{prefix}</div>}
<Input
{...props}
+3 -1
View File
@@ -1,6 +1,7 @@
'use client';
import Lottie, { LottieComponentProps } from 'lottie-react';
import { type LottieComponentProps } from 'lottie-react';
import dynamic from 'next/dynamic';
import gift from './gift.json';
import globalMap from './global-map.json';
import loading from './loading.json';
@@ -12,6 +13,7 @@ import rocket from './rocket.json';
import servers from './servers.json';
import sun from './sun.json';
import users from './users.json';
const Lottie = dynamic(() => import('lottie-react'), { ssr: false });
export function RocketLoadingIcon(props: Omit<LottieComponentProps, 'animationData'>) {
return <Lottie {...props} loop animationData={rocket} />;
-10
View File
@@ -1,10 +0,0 @@
{
"compilerOptions": {
"outDir": "dist",
"module": "ESNext",
"moduleResolution": "Bundler"
},
"exclude": ["node_modules", "dist"],
"extends": "@repo/typescript-config/react-library.json",
"include": ["src", "turbo", "*.mjs", "*.ts"]
}