🐛 fix(types): Checking
This commit is contained in:
parent
c7e50a9b84
commit
2992824353
10
.eslintrc.js
10
.eslintrc.js
@ -1,10 +0,0 @@
|
|||||||
// This configuration only applies to the package manager root.
|
|
||||||
/** @type {import("eslint").Linter.Config} */
|
|
||||||
module.exports = {
|
|
||||||
ignorePatterns: ['apps/**', 'packages/**'],
|
|
||||||
extends: ['@repo/eslint-config/library.js'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
/** @type {import("eslint").Linter.Config} */
|
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
extends: ['@repo/eslint-config/next.js'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-namespace': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -68,6 +68,7 @@ export default function UserCheckForm({
|
|||||||
clearTimeout(typingTimeoutRef.current);
|
clearTimeout(typingTimeoutRef.current);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -448,7 +448,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
max: 100,
|
max: 100,
|
||||||
placeholder: t('form.discountPercent'),
|
placeholder: t('form.discountPercent'),
|
||||||
suffix: '%',
|
suffix: '%',
|
||||||
calculateValue: (data) => {
|
calculateValue: function (data) {
|
||||||
const { unit_price } = form.getValues();
|
const { unit_price } = form.getValues();
|
||||||
return {
|
return {
|
||||||
...data,
|
...data,
|
||||||
@ -466,7 +466,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
formatInput: (value) => unitConversion('centsToDollars', value),
|
formatInput: (value) => unitConversion('centsToDollars', value),
|
||||||
formatOutput: (value) => unitConversion('dollarsToCents', value),
|
formatOutput: (value) => unitConversion('dollarsToCents', value),
|
||||||
internal: true,
|
internal: true,
|
||||||
calculateValue: (data) => {
|
calculateValue: function (data) {
|
||||||
const { unit_price } = form.getValues();
|
const { unit_price } = form.getValues();
|
||||||
return {
|
return {
|
||||||
...data,
|
...data,
|
||||||
|
|||||||
13
apps/admin/eslint.config.js
Normal file
13
apps/admin/eslint.config.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { nextJsConfig } from '@repo/eslint-config/next-js';
|
||||||
|
|
||||||
|
/** @type {import("eslint").Linter.Config} */
|
||||||
|
export default [
|
||||||
|
...nextJsConfig,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-namespace': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@ -13,15 +13,15 @@
|
|||||||
"@iconify/react": "^5.0.2",
|
"@iconify/react": "^5.0.2",
|
||||||
"@repo/ui": "workspace:*",
|
"@repo/ui": "workspace:*",
|
||||||
"@shadcn/ui": "workspace:*",
|
"@shadcn/ui": "workspace:*",
|
||||||
"@tanstack/react-query": "^5.60.2",
|
"@tanstack/react-query": "^5.61.3",
|
||||||
"@tanstack/react-query-next-experimental": "^5.60.2",
|
"@tanstack/react-query-next-experimental": "^5.61.3",
|
||||||
"ahooks": "^3.8.1",
|
"ahooks": "^3.8.1",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.8",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"mathjs": "^13.2.2",
|
"mathjs": "^14.0.0",
|
||||||
"nanoid": "^5.0.8",
|
"nanoid": "^5.0.9",
|
||||||
"next": "^15.0.3",
|
"next": "^15.0.3",
|
||||||
"next-intl": "^3.25.1",
|
"next-intl": "^3.25.3",
|
||||||
"next-runtime-env": "^3.2.2",
|
"next-runtime-env": "^3.2.2",
|
||||||
"next-themes": "^0.4.3",
|
"next-themes": "^0.4.3",
|
||||||
"nextjs-toploader": "^3.7.15",
|
"nextjs-toploader": "^3.7.15",
|
||||||
@ -35,9 +35,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@repo/eslint-config": "workspace:*",
|
"@repo/eslint-config": "workspace:*",
|
||||||
"@repo/typescript-config": "workspace:*",
|
"@repo/typescript-config": "workspace:*",
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,10 @@
|
|||||||
|
import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants';
|
||||||
import { getTranslations } from '@/locales/utils';
|
import { getTranslations } from '@/locales/utils';
|
||||||
import { isBrowser } from '@repo/ui/utils';
|
import { isBrowser } from '@repo/ui/utils';
|
||||||
import { toast } from '@shadcn/ui/lib/sonner';
|
import { toast } from '@shadcn/ui/lib/sonner';
|
||||||
import axios, { InternalAxiosRequestConfig } from 'axios';
|
import requset, { InternalAxiosRequestConfig } from 'axios';
|
||||||
import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '../config/constants';
|
|
||||||
import { getAuthorization, Logout } from './common';
|
import { getAuthorization, Logout } from './common';
|
||||||
|
|
||||||
const request = axios.create({
|
|
||||||
baseURL: NEXT_PUBLIC_API_URL || NEXT_PUBLIC_SITE_URL,
|
|
||||||
// withCredentials: true,
|
|
||||||
// withXSRFToken: true,
|
|
||||||
timeout: 10000,
|
|
||||||
});
|
|
||||||
|
|
||||||
async function handleError(response: any) {
|
async function handleError(response: any) {
|
||||||
const code = response.data?.code;
|
const code = response.data?.code;
|
||||||
if (response?.config?.skipErrorHandler) return;
|
if (response?.config?.skipErrorHandler) return;
|
||||||
@ -27,7 +20,11 @@ async function handleError(response: any) {
|
|||||||
toast.error(message);
|
toast.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
request.interceptors.request.use(
|
requset.defaults.baseURL = NEXT_PUBLIC_API_URL || NEXT_PUBLIC_SITE_URL;
|
||||||
|
// axios.defaults.withCredentials = true;
|
||||||
|
// axios.defaults.timeout = 10000;
|
||||||
|
|
||||||
|
requset.interceptors.request.use(
|
||||||
async (
|
async (
|
||||||
config: InternalAxiosRequestConfig & {
|
config: InternalAxiosRequestConfig & {
|
||||||
Authorization?: string;
|
Authorization?: string;
|
||||||
@ -40,7 +37,7 @@ request.interceptors.request.use(
|
|||||||
(error) => Promise.reject(error),
|
(error) => Promise.reject(error),
|
||||||
);
|
);
|
||||||
|
|
||||||
request.interceptors.response.use(
|
requset.interceptors.response.use(
|
||||||
async (response) => {
|
async (response) => {
|
||||||
const { code } = response.data;
|
const { code } = response.data;
|
||||||
if (code !== 200) throw response;
|
if (code !== 200) throw response;
|
||||||
@ -52,4 +49,4 @@ request.interceptors.response.use(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export default request;
|
export default requset;
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
/** @type {import("eslint").Linter.Config} */
|
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
extends: ['@repo/eslint-config/next.js'],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
project: true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-namespace': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -71,6 +71,7 @@ export default function UserCheckForm({
|
|||||||
clearTimeout(typingTimeoutRef.current);
|
clearTimeout(typingTimeoutRef.current);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
13
apps/user/eslint.config.js
Normal file
13
apps/user/eslint.config.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { nextJsConfig } from '@repo/eslint-config/next-js';
|
||||||
|
|
||||||
|
/** @type {import("eslint").Linter.Config} */
|
||||||
|
export default [
|
||||||
|
...nextJsConfig,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-namespace': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@ -4,7 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"dev": "next dev --turbopack -p 3001",
|
"dev": "next dev --turbopack -p 3001",
|
||||||
"lint": "next lint && tsc --noEmit",
|
"lint": "next lint --max-warnings 0 && tsc --noEmit",
|
||||||
"locale": "lobe-i18n --with-md",
|
"locale": "lobe-i18n --with-md",
|
||||||
"openapi": "openapi2ts",
|
"openapi": "openapi2ts",
|
||||||
"start": "next start"
|
"start": "next start"
|
||||||
@ -13,18 +13,18 @@
|
|||||||
"@iconify/react": "^5.0.2",
|
"@iconify/react": "^5.0.2",
|
||||||
"@repo/ui": "workspace:*",
|
"@repo/ui": "workspace:*",
|
||||||
"@shadcn/ui": "workspace:*",
|
"@shadcn/ui": "workspace:*",
|
||||||
"@stripe/react-stripe-js": "^2.9.0",
|
"@stripe/react-stripe-js": "^3.0.0",
|
||||||
"@stripe/stripe-js": "^4.10.0",
|
"@stripe/stripe-js": "^5.2.0",
|
||||||
"@tanstack/react-query": "^5.60.2",
|
"@tanstack/react-query": "^5.61.3",
|
||||||
"@tanstack/react-query-next-experimental": "^5.60.2",
|
"@tanstack/react-query-next-experimental": "^5.61.3",
|
||||||
"ahooks": "^3.8.1",
|
"ahooks": "^3.8.1",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.8",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"framer-motion": "^11.11.16",
|
"framer-motion": "^11.11.17",
|
||||||
"lucide-react": "^0.456.0",
|
"lucide-react": "^0.461.0",
|
||||||
"mathjs": "^13.2.2",
|
"mathjs": "^14.0.0",
|
||||||
"next": "^15.0.3",
|
"next": "^15.0.3",
|
||||||
"next-intl": "^3.25.1",
|
"next-intl": "^3.25.3",
|
||||||
"next-runtime-env": "^3.2.2",
|
"next-runtime-env": "^3.2.2",
|
||||||
"next-themes": "^0.4.3",
|
"next-themes": "^0.4.3",
|
||||||
"nextjs-toploader": "^3.7.15",
|
"nextjs-toploader": "^3.7.15",
|
||||||
@ -39,9 +39,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@repo/eslint-config": "workspace:*",
|
"@repo/eslint-config": "workspace:*",
|
||||||
"@repo/typescript-config": "workspace:*",
|
"@repo/typescript-config": "workspace:*",
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"plugins": [{ "name": "next" }],
|
"plugins": [{ "name": "next" }],
|
||||||
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./*"]
|
"@/*": ["./*"]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,16 +2,9 @@ import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants';
|
|||||||
import { getTranslations } from '@/locales/utils';
|
import { getTranslations } from '@/locales/utils';
|
||||||
import { isBrowser } from '@repo/ui/utils';
|
import { isBrowser } from '@repo/ui/utils';
|
||||||
import { toast } from '@shadcn/ui/lib/sonner';
|
import { toast } from '@shadcn/ui/lib/sonner';
|
||||||
import axios, { InternalAxiosRequestConfig } from 'axios';
|
import requset, { InternalAxiosRequestConfig } from 'axios';
|
||||||
import { getAuthorization, Logout } from './common';
|
import { getAuthorization, Logout } from './common';
|
||||||
|
|
||||||
const request = axios.create({
|
|
||||||
baseURL: NEXT_PUBLIC_API_URL || NEXT_PUBLIC_SITE_URL,
|
|
||||||
// withCredentials: true,
|
|
||||||
// withXSRFToken: true,
|
|
||||||
timeout: 10000,
|
|
||||||
});
|
|
||||||
|
|
||||||
async function handleError(response: any) {
|
async function handleError(response: any) {
|
||||||
const code = response.data?.code;
|
const code = response.data?.code;
|
||||||
if (response?.config?.skipErrorHandler) return;
|
if (response?.config?.skipErrorHandler) return;
|
||||||
@ -27,7 +20,11 @@ async function handleError(response: any) {
|
|||||||
toast.error(message);
|
toast.error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
request.interceptors.request.use(
|
requset.defaults.baseURL = NEXT_PUBLIC_API_URL || NEXT_PUBLIC_SITE_URL;
|
||||||
|
// axios.defaults.withCredentials = true;
|
||||||
|
// axios.defaults.timeout = 10000;
|
||||||
|
|
||||||
|
requset.interceptors.request.use(
|
||||||
async (
|
async (
|
||||||
config: InternalAxiosRequestConfig & {
|
config: InternalAxiosRequestConfig & {
|
||||||
Authorization?: string;
|
Authorization?: string;
|
||||||
@ -40,7 +37,7 @@ request.interceptors.request.use(
|
|||||||
(error) => Promise.reject(error),
|
(error) => Promise.reject(error),
|
||||||
);
|
);
|
||||||
|
|
||||||
request.interceptors.response.use(
|
requset.interceptors.response.use(
|
||||||
async (response) => {
|
async (response) => {
|
||||||
const { code } = response.data;
|
const { code } = response.data;
|
||||||
if (code !== 200) throw response;
|
if (code !== 200) throw response;
|
||||||
@ -52,4 +49,4 @@ request.interceptors.response.use(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
export default request;
|
export default requset;
|
||||||
|
|||||||
4
eslint.config.js
Normal file
4
eslint.config.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import { config } from '@repo/eslint-config/base';
|
||||||
|
|
||||||
|
/** @type {import("eslint").Linter.Config} */
|
||||||
|
export default config;
|
||||||
@ -41,12 +41,12 @@
|
|||||||
"@repo/commitlint-config": "workspace:*",
|
"@repo/commitlint-config": "workspace:*",
|
||||||
"@repo/prettier-config": "workspace:*",
|
"@repo/prettier-config": "workspace:*",
|
||||||
"@umijs/openapi": "^1.13.0",
|
"@umijs/openapi": "^1.13.0",
|
||||||
"husky": "^9.1.6",
|
"husky": "^9.1.7",
|
||||||
"lint-staged": "^15.2.10",
|
"lint-staged": "^15.2.10",
|
||||||
"semantic-release": "^21.1.2",
|
"semantic-release": "^24.2.0",
|
||||||
"semantic-release-config-gitmoji": "^1.5.3",
|
"semantic-release-config-gitmoji": "^1.5.3",
|
||||||
"turbo": "^2.2.3",
|
"turbo": "^2.3.2",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.7.2"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.12.3",
|
"packageManager": "pnpm@9.12.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.5.0",
|
"@commitlint/cli": "^19.6.0",
|
||||||
"commitlint": "^19.5.0",
|
"commitlint": "^19.6.0",
|
||||||
"commitlint-config-gitmoji": "^2.3.1"
|
"commitlint-config-gitmoji": "^2.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
32
packages/eslint-config/base.js
Normal file
32
packages/eslint-config/base.js
Normal 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/**'],
|
||||||
|
},
|
||||||
|
];
|
||||||
@ -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)'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
@ -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');
|
/**
|
||||||
|
* A custom ESLint configuration for libraries that use Next.js.
|
||||||
/** @type {import("eslint").Linter.Config} */
|
*
|
||||||
module.exports = {
|
* @type {import("eslint").Linter.Config}
|
||||||
extends: [
|
* */
|
||||||
'eslint:recommended',
|
export const nextJsConfig = [
|
||||||
'plugin:@typescript-eslint/recommended',
|
...baseConfig,
|
||||||
'prettier',
|
js.configs.recommended,
|
||||||
require.resolve('@vercel/style-guide/eslint/next'),
|
eslintConfigPrettier,
|
||||||
'turbo',
|
...tseslint.configs.recommended,
|
||||||
],
|
{
|
||||||
globals: {
|
...pluginReact.configs.flat.recommended,
|
||||||
React: true,
|
languageOptions: {
|
||||||
JSX: true,
|
...pluginReact.configs.flat.recommended.languageOptions,
|
||||||
},
|
globals: {
|
||||||
env: {
|
...globals.serviceworker,
|
||||||
node: true,
|
|
||||||
browser: true,
|
|
||||||
},
|
|
||||||
plugins: ['only-warn'],
|
|
||||||
settings: {
|
|
||||||
'import/resolver': {
|
|
||||||
typescript: {
|
|
||||||
project,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ignorePatterns: [
|
{
|
||||||
// Ignore dotfiles
|
plugins: {
|
||||||
'.*.js',
|
'@next/next': pluginNext,
|
||||||
'node_modules/',
|
},
|
||||||
],
|
rules: {
|
||||||
overrides: [{ files: ['*.js?(x)', '*.ts?(x)'] }],
|
...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',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@ -1,21 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/eslint-config",
|
"name": "@repo/eslint-config",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
"type": "module",
|
||||||
"library.js",
|
"exports": {
|
||||||
"next.js",
|
"./base": "./base.js",
|
||||||
"react-internal.js"
|
"./next-js": "./next.js",
|
||||||
],
|
"./react-internal": "./react-internal.js"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@next/eslint-plugin-next": "^15.0.3",
|
"@next/eslint-plugin-next": "^15.0.3",
|
||||||
"@types/eslint": "^8",
|
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
"@typescript-eslint/parser": "^8.16.0",
|
||||||
"@typescript-eslint/parser": "^8.14.0",
|
"eslint": "^9.15.0",
|
||||||
"@vercel/style-guide": "^6.0.0",
|
|
||||||
"eslint": "^8",
|
|
||||||
"eslint-config-next": "^15.0.3",
|
|
||||||
"eslint-config-prettier": "^9.1.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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
70
packages/eslint-config/react-internal.js
vendored
70
packages/eslint-config/react-internal.js
vendored
@ -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');
|
/**
|
||||||
|
* A custom ESLint configuration for libraries that use React.
|
||||||
/*
|
*
|
||||||
* This is a custom ESLint configuration for use with
|
* @type {import("eslint").Linter.Config} */
|
||||||
* internal (bundled by their consumer) libraries
|
export const config = [
|
||||||
* that utilize React.
|
...baseConfig,
|
||||||
*/
|
js.configs.recommended,
|
||||||
|
eslintConfigPrettier,
|
||||||
/** @type {import("eslint").Linter.Config} */
|
...tseslint.configs.recommended,
|
||||||
module.exports = {
|
pluginReact.configs.flat.recommended,
|
||||||
extends: ['eslint:recommended', 'prettier', 'turbo'],
|
{
|
||||||
plugins: ['only-warn'],
|
languageOptions: {
|
||||||
globals: {
|
...pluginReact.configs.flat.recommended.languageOptions,
|
||||||
React: true,
|
globals: {
|
||||||
JSX: true,
|
...globals.serviceworker,
|
||||||
},
|
...globals.browser,
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
},
|
|
||||||
settings: {
|
|
||||||
'import/resolver': {
|
|
||||||
typescript: {
|
|
||||||
project,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ignorePatterns: [
|
{
|
||||||
// Ignore dotfiles
|
plugins: {
|
||||||
'.*.js',
|
'react-hooks': pluginReactHooks,
|
||||||
'node_modules/',
|
},
|
||||||
'dist/',
|
settings: { react: { version: 'detect' } },
|
||||||
],
|
rules: {
|
||||||
overrides: [
|
...pluginReactHooks.configs.recommended.rules,
|
||||||
// Force ESLint to detect .tsx files
|
// React scope no longer necessary with new JSX transform.
|
||||||
{ files: ['*.js?(x)', '*.ts?(x)'] },
|
'react/react-in-jsx-scope': 'off',
|
||||||
],
|
},
|
||||||
};
|
},
|
||||||
|
];
|
||||||
|
|||||||
@ -4,12 +4,12 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
|
"@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-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-sh": "^0.14.0",
|
||||||
"prettier-plugin-sort-json": "^4.0.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"
|
"prettier-plugin-two-style-order": "^1.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
packages/shadcn/eslint.config.js
Normal file
23
packages/shadcn/eslint.config.js
Normal 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',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"@radix-ui/react-dialog": "^1.1.2",
|
"@radix-ui/react-dialog": "^1.1.2",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
||||||
"@radix-ui/react-hover-card": "^1.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-label": "^2.1.0",
|
||||||
"@radix-ui/react-menubar": "^1.1.2",
|
"@radix-ui/react-menubar": "^1.1.2",
|
||||||
"@radix-ui/react-navigation-menu": "^1.2.1",
|
"@radix-ui/react-navigation-menu": "^1.2.1",
|
||||||
@ -44,21 +44,21 @@
|
|||||||
"@radix-ui/react-toggle": "^1.1.0",
|
"@radix-ui/react-toggle": "^1.1.0",
|
||||||
"@radix-ui/react-toggle-group": "^1.1.0",
|
"@radix-ui/react-toggle-group": "^1.1.0",
|
||||||
"@radix-ui/react-tooltip": "^1.1.4",
|
"@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",
|
"@react-three/fiber": "^8.17.10",
|
||||||
"@tabler/icons-react": "^3.22.0",
|
"@tabler/icons-react": "^3.22.0",
|
||||||
"@tsparticles/engine": "^3.5.0",
|
"@tsparticles/engine": "^3.7.1",
|
||||||
"@tsparticles/react": "^3.0.0",
|
"@tsparticles/react": "^3.0.0",
|
||||||
"@tsparticles/slim": "^3.5.0",
|
"@tsparticles/slim": "^3.7.1",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cmdk": "1.0.4",
|
"cmdk": "1.0.4",
|
||||||
"cobe": "^0.6.3",
|
"cobe": "^0.6.3",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"embla-carousel-react": "^8.3.1",
|
"embla-carousel-react": "^8.5.1",
|
||||||
"framer-motion": "^11.11.16",
|
"framer-motion": "^11.11.17",
|
||||||
"input-otp": "^1.4.1",
|
"input-otp": "^1.4.1",
|
||||||
"lucide-react": "^0.456.0",
|
"lucide-react": "^0.461.0",
|
||||||
"mini-svg-data-uri": "^1.4.4",
|
"mini-svg-data-uri": "^1.4.4",
|
||||||
"next-themes": "^0.4.3",
|
"next-themes": "^0.4.3",
|
||||||
"qss": "^3.0.0",
|
"qss": "^3.0.0",
|
||||||
@ -66,21 +66,21 @@
|
|||||||
"react-dropzone": "^14.3.5",
|
"react-dropzone": "^14.3.5",
|
||||||
"react-hook-form": "^7.53.2",
|
"react-hook-form": "^7.53.2",
|
||||||
"react-icons": "^5.3.0",
|
"react-icons": "^5.3.0",
|
||||||
"react-resizable-panels": "^2.1.6",
|
"react-resizable-panels": "^2.1.7",
|
||||||
"recharts": "^2.13.3",
|
"recharts": "^2.13.3",
|
||||||
"simplex-noise": "^4.0.3",
|
"simplex-noise": "^4.0.3",
|
||||||
"sonner": "^1.7.0",
|
"sonner": "^1.7.0",
|
||||||
"tailwind-merge": "^2.5.4",
|
"tailwind-merge": "^2.5.5",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"three": "^0.170.0",
|
"three": "^0.170.0",
|
||||||
"three-globe": "^2.34.4",
|
"three-globe": "^2.35.2",
|
||||||
"vaul": "^1.1.1",
|
"vaul": "^1.1.1",
|
||||||
"zod": "^3.23.8"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@repo/eslint-config": "workspace:*",
|
"@repo/eslint-config": "workspace:*",
|
||||||
"@repo/typescript-config": "workspace:*",
|
"@repo/typescript-config": "workspace:*",
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@types/three": "^0.170.0",
|
"@types/three": "^0.170.0",
|
||||||
@ -88,7 +88,7 @@
|
|||||||
"next": "^15.0.3",
|
"next": "^15.0.3",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"tailwindcss": "^3.4.14",
|
"tailwindcss": "^3.4.15",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "dist"
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "dist"],
|
|
||||||
"extends": "@repo/typescript-config/react-library.json",
|
|
||||||
"include": ["src", "*.mjs", "*.ts"]
|
|
||||||
}
|
|
||||||
@ -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
packages/ui/eslint.config.js
Normal file
23
packages/ui/eslint.config.js
Normal 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',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@ -16,15 +16,15 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@monaco-editor/react": "^4.6.0",
|
"@monaco-editor/react": "^4.6.0",
|
||||||
"@radix-ui/react-icons": "^1.3.1",
|
"@radix-ui/react-icons": "^1.3.2",
|
||||||
"@shadcn/ui": "workspace:*",
|
"@shadcn/ui": "workspace:*",
|
||||||
"@tanstack/react-table": "^8.20.5",
|
"@tanstack/react-table": "^8.20.5",
|
||||||
"@types/react-syntax-highlighter": "^15.5.13",
|
"@types/react-syntax-highlighter": "^15.5.13",
|
||||||
"ahooks": "^3.8.1",
|
"ahooks": "^3.8.1",
|
||||||
"katex": "^0.16.11",
|
"katex": "^0.16.11",
|
||||||
"lottie-react": "^2.4.0",
|
"lottie-react": "^2.4.0",
|
||||||
"lucide-react": "^0.456.0",
|
"lucide-react": "^0.461.0",
|
||||||
"mathjs": "^13.2.2",
|
"mathjs": "^14.0.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
"react-syntax-highlighter": "^15.6.1",
|
"react-syntax-highlighter": "^15.6.1",
|
||||||
@ -37,14 +37,15 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@repo/eslint-config": "workspace:*",
|
"@repo/eslint-config": "workspace:*",
|
||||||
"@repo/typescript-config": "workspace:*",
|
"@repo/typescript-config": "workspace:*",
|
||||||
"@turbo/gen": "^2.2.3",
|
"@turbo/gen": "^2.3.2",
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
|
"next": "^15.0.3",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"tailwindcss": "^3.4.14",
|
"tailwindcss": "^3.4.15",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import Editor, { OnMount } from '@monaco-editor/react';
|
import { type OnMount } from '@monaco-editor/react';
|
||||||
import { Button } from '@shadcn/ui/button';
|
import { Button } from '@shadcn/ui/button';
|
||||||
import { cn } from '@shadcn/ui/lib/utils';
|
import { cn } from '@shadcn/ui/lib/utils';
|
||||||
import { useSize } from 'ahooks';
|
import { useSize } from 'ahooks';
|
||||||
import { EyeIcon, EyeOff, FullscreenIcon, MinimizeIcon } from 'lucide-react';
|
import { EyeIcon, EyeOff, FullscreenIcon, MinimizeIcon } from 'lucide-react';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
|
const Editor = dynamic(() => import('@monaco-editor/react'), { ssr: false });
|
||||||
|
|
||||||
export interface MonacoEditorProps {
|
export interface MonacoEditorProps {
|
||||||
value?: string;
|
value?: string;
|
||||||
|
|||||||
@ -71,7 +71,10 @@ export function EnhancedInput({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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>}
|
{prefix && <div className='bg-muted mr-px flex h-9 items-center px-3'>{prefix}</div>}
|
||||||
<Input
|
<Input
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'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 gift from './gift.json';
|
||||||
import globalMap from './global-map.json';
|
import globalMap from './global-map.json';
|
||||||
import loading from './loading.json';
|
import loading from './loading.json';
|
||||||
@ -12,6 +13,7 @@ import rocket from './rocket.json';
|
|||||||
import servers from './servers.json';
|
import servers from './servers.json';
|
||||||
import sun from './sun.json';
|
import sun from './sun.json';
|
||||||
import users from './users.json';
|
import users from './users.json';
|
||||||
|
const Lottie = dynamic(() => import('lottie-react'), { ssr: false });
|
||||||
|
|
||||||
export function RocketLoadingIcon(props: Omit<LottieComponentProps, 'animationData'>) {
|
export function RocketLoadingIcon(props: Omit<LottieComponentProps, 'animationData'>) {
|
||||||
return <Lottie {...props} loop animationData={rocket} />;
|
return <Lottie {...props} loop animationData={rocket} />;
|
||||||
|
|||||||
@ -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"]
|
|
||||||
}
|
|
||||||
4669
pnpm-lock.yaml
generated
4669
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user