🐛 fix(types): Checking
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -448,7 +448,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
max: 100,
|
||||
placeholder: t('form.discountPercent'),
|
||||
suffix: '%',
|
||||
calculateValue: (data) => {
|
||||
calculateValue: function (data) {
|
||||
const { unit_price } = form.getValues();
|
||||
return {
|
||||
...data,
|
||||
@@ -466,7 +466,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
formatInput: (value) => unitConversion('centsToDollars', value),
|
||||
formatOutput: (value) => unitConversion('dollarsToCents', value),
|
||||
internal: true,
|
||||
calculateValue: (data) => {
|
||||
calculateValue: function (data) {
|
||||
const { unit_price } = form.getValues();
|
||||
return {
|
||||
...data,
|
||||
|
||||
@@ -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",
|
||||
"@repo/ui": "workspace:*",
|
||||
"@shadcn/ui": "workspace:*",
|
||||
"@tanstack/react-query": "^5.60.2",
|
||||
"@tanstack/react-query-next-experimental": "^5.60.2",
|
||||
"@tanstack/react-query": "^5.61.3",
|
||||
"@tanstack/react-query-next-experimental": "^5.61.3",
|
||||
"ahooks": "^3.8.1",
|
||||
"axios": "^1.7.7",
|
||||
"axios": "^1.7.8",
|
||||
"crypto-js": "^4.2.0",
|
||||
"mathjs": "^13.2.2",
|
||||
"nanoid": "^5.0.8",
|
||||
"mathjs": "^14.0.0",
|
||||
"nanoid": "^5.0.9",
|
||||
"next": "^15.0.3",
|
||||
"next-intl": "^3.25.1",
|
||||
"next-intl": "^3.25.3",
|
||||
"next-runtime-env": "^3.2.2",
|
||||
"next-themes": "^0.4.3",
|
||||
"nextjs-toploader": "^3.7.15",
|
||||
@@ -35,9 +35,9 @@
|
||||
"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",
|
||||
"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 { isBrowser } from '@repo/ui/utils';
|
||||
import { toast } from '@shadcn/ui/lib/sonner';
|
||||
import axios, { InternalAxiosRequestConfig } from 'axios';
|
||||
import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '../config/constants';
|
||||
import requset, { InternalAxiosRequestConfig } from 'axios';
|
||||
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) {
|
||||
const code = response.data?.code;
|
||||
if (response?.config?.skipErrorHandler) return;
|
||||
@@ -27,7 +20,11 @@ async function handleError(response: any) {
|
||||
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 (
|
||||
config: InternalAxiosRequestConfig & {
|
||||
Authorization?: string;
|
||||
@@ -40,7 +37,7 @@ request.interceptors.request.use(
|
||||
(error) => Promise.reject(error),
|
||||
);
|
||||
|
||||
request.interceptors.response.use(
|
||||
requset.interceptors.response.use(
|
||||
async (response) => {
|
||||
const { code } = response.data;
|
||||
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);
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
},
|
||||
];
|
||||
+12
-12
@@ -4,7 +4,7 @@
|
||||
"scripts": {
|
||||
"build": "next build",
|
||||
"dev": "next dev --turbopack -p 3001",
|
||||
"lint": "next lint && tsc --noEmit",
|
||||
"lint": "next lint --max-warnings 0 && tsc --noEmit",
|
||||
"locale": "lobe-i18n --with-md",
|
||||
"openapi": "openapi2ts",
|
||||
"start": "next start"
|
||||
@@ -13,18 +13,18 @@
|
||||
"@iconify/react": "^5.0.2",
|
||||
"@repo/ui": "workspace:*",
|
||||
"@shadcn/ui": "workspace:*",
|
||||
"@stripe/react-stripe-js": "^2.9.0",
|
||||
"@stripe/stripe-js": "^4.10.0",
|
||||
"@tanstack/react-query": "^5.60.2",
|
||||
"@tanstack/react-query-next-experimental": "^5.60.2",
|
||||
"@stripe/react-stripe-js": "^3.0.0",
|
||||
"@stripe/stripe-js": "^5.2.0",
|
||||
"@tanstack/react-query": "^5.61.3",
|
||||
"@tanstack/react-query-next-experimental": "^5.61.3",
|
||||
"ahooks": "^3.8.1",
|
||||
"axios": "^1.7.7",
|
||||
"axios": "^1.7.8",
|
||||
"crypto-js": "^4.2.0",
|
||||
"framer-motion": "^11.11.16",
|
||||
"lucide-react": "^0.456.0",
|
||||
"mathjs": "^13.2.2",
|
||||
"framer-motion": "^11.11.17",
|
||||
"lucide-react": "^0.461.0",
|
||||
"mathjs": "^14.0.0",
|
||||
"next": "^15.0.3",
|
||||
"next-intl": "^3.25.1",
|
||||
"next-intl": "^3.25.3",
|
||||
"next-runtime-env": "^3.2.2",
|
||||
"next-themes": "^0.4.3",
|
||||
"nextjs-toploader": "^3.7.15",
|
||||
@@ -39,9 +39,9 @@
|
||||
"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",
|
||||
"typescript": "^5.6.3"
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"plugins": [{ "name": "next" }],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
|
||||
@@ -2,16 +2,9 @@ import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants';
|
||||
import { getTranslations } from '@/locales/utils';
|
||||
import { isBrowser } from '@repo/ui/utils';
|
||||
import { toast } from '@shadcn/ui/lib/sonner';
|
||||
import axios, { InternalAxiosRequestConfig } from 'axios';
|
||||
import requset, { InternalAxiosRequestConfig } from 'axios';
|
||||
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) {
|
||||
const code = response.data?.code;
|
||||
if (response?.config?.skipErrorHandler) return;
|
||||
@@ -27,7 +20,11 @@ async function handleError(response: any) {
|
||||
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 (
|
||||
config: InternalAxiosRequestConfig & {
|
||||
Authorization?: string;
|
||||
@@ -40,7 +37,7 @@ request.interceptors.request.use(
|
||||
(error) => Promise.reject(error),
|
||||
);
|
||||
|
||||
request.interceptors.response.use(
|
||||
requset.interceptors.response.use(
|
||||
async (response) => {
|
||||
const { code } = response.data;
|
||||
if (code !== 200) throw response;
|
||||
@@ -52,4 +49,4 @@ request.interceptors.response.use(
|
||||
},
|
||||
);
|
||||
|
||||
export default request;
|
||||
export default requset;
|
||||
|
||||
Reference in New Issue
Block a user