Skip to content

Commit

Permalink
refactor(dx): fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrishajev committed Jan 16, 2025
1 parent 624db94 commit 1115a60
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useRouter } from "next/navigation";

import { CI_CD_TEMPLATE_ID } from "@src/config/remote-deploy.config";
import { useTemplates } from "@src/context/TemplatesProvider";
import { TemplateOutputSummaryWithCategory } from "@src/queries/useTemplateQuery";
import sdlStore from "@src/store/sdlStore";
import { TemplateCreation } from "@src/types";
import { RouteStep } from "@src/types/route-steps.type";
Expand All @@ -17,7 +18,6 @@ import { domainName, NewDeploymentParams, UrlService } from "@src/utils/urlUtils
import { CustomNextSeo } from "../shared/CustomNextSeo";
import { TemplateBox } from "../templates/TemplateBox";
import { DeployOptionBox } from "./DeployOptionBox";
import { TemplateOutputSummaryWithCategory } from "@src/queries/useTemplateQuery";

const previewTemplateIds = [
"akash-network-awesome-akash-Llama-3.1-8B",
Expand Down
4 changes: 2 additions & 2 deletions apps/deploy-web/src/components/sdl/ImageSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use client";
import { ReactNode, useEffect, useLayoutEffect, useRef, useState } from "react";
import { Control, Controller } from "react-hook-form";
import { buttonVariants, CustomTooltip } from "@akashnetwork/ui/components";
import { cn } from "@akashnetwork/ui/utils";
import ClickAwayListener from "@mui/material/ClickAwayListener";
Expand All @@ -9,8 +11,6 @@ import TextField from "@mui/material/TextField";
import { InfoCircle, OpenNewWindow } from "iconoir-react";
import Image from "next/image";
import Link from "next/link";
import { ReactNode, useEffect, useLayoutEffect, useRef, useState } from "react";
import { Control, Controller } from "react-hook-form";

import { useGpuTemplates } from "@src/hooks/useGpuTemplates";
import { TemplateOutputSummaryWithCategory } from "@src/queries/useTemplateQuery";
Expand Down
4 changes: 2 additions & 2 deletions apps/deploy-web/src/components/sdl/RentGpusForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use client";
import { useEffect, useRef, useState } from "react";
import { useForm } from "react-hook-form";
import { certificateManager } from "@akashnetwork/akashjs/build/certificates/certificate-manager";
import { Alert, Button, Form, Spinner } from "@akashnetwork/ui/components";
import { EncodeObject } from "@cosmjs/proto-signing";
Expand All @@ -7,8 +9,6 @@ import { Rocket } from "iconoir-react";
import { useAtom } from "jotai";
import { useRouter, useSearchParams } from "next/navigation";
import { event } from "nextjs-google-analytics";
import { useEffect, useRef, useState } from "react";
import { useForm } from "react-hook-form";

import { browserEnvConfig } from "@src/config/browser-env.config";
import { useCertificate } from "@src/context/CertificateProvider";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Edit } from "iconoir-react";
import { useRouter } from "next/navigation";
import { NextSeo } from "next-seo";

import { AutoTopUpSetting } from "@src/components/settings/AutoTopUpSetting/AutoTopUpSetting";
import { AutoTopUpSettingContainer } from "@src/components/settings/AutoTopUpSetting/AutoTopUpSettingContainer";
import { LocalDataManager } from "@src/components/settings/LocalDataManager";
import { Fieldset } from "@src/components/shared/Fieldset";
Expand Down
1 change: 0 additions & 1 deletion apps/deploy-web/src/components/shared/VerifyEmail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Alert, AlertDescription } from "@akashnetwork/ui/components";
import { cn } from "@akashnetwork/ui/utils";
import { WarningCircle } from "iconoir-react";

import { useIsEmailVerified } from "@src/hooks/useRequiredEmailVerified";
Expand Down
4 changes: 2 additions & 2 deletions apps/deploy-web/src/components/templates/TemplateGallery.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";
import { useEffect, useState } from "react";
import { MdSearchOff } from "react-icons/md";
import { Button, buttonVariants, Spinner } from "@akashnetwork/ui/components";
import { cn } from "@akashnetwork/ui/utils";
import IconButton from "@mui/material/IconButton";
import TextField from "@mui/material/TextField";
import { FilterList, Xmark } from "iconoir-react";
import { useRouter, useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
import { MdSearchOff } from "react-icons/md";

import { LinkTo } from "@src/components/shared/LinkTo";
import { TemplateOutputSummaryWithCategory } from "@src/queries/useTemplateQuery";
Expand Down
2 changes: 0 additions & 2 deletions apps/deploy-web/src/queries/useBidQuery.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { QueryKey, useQuery, UseQueryOptions } from "react-query";
import axios from "axios";

import { useWallet } from "@src/context/WalletProvider";
import { BidDto, RpcBid } from "@src/types/deployment";
import { ApiUrlService } from "@src/utils/apiUtils";
import { useSettings } from "../context/SettingsProvider";
Expand All @@ -28,7 +27,6 @@ async function getBidList(apiEndpoint: string, address: string, dseq: string): P

export function useBidList(address: string, dseq: string, options?: Omit<UseQueryOptions<BidDto[], Error, any, QueryKey>, "queryKey" | "queryFn">) {
const { settings } = useSettings();
const { isTrialing } = useWallet();

return useQuery(QueryKeys.getBidListKey(address, dseq), () => getBidList(settings.apiEndpoint, address, dseq), options);
}
Expand Down
12 changes: 6 additions & 6 deletions apps/deploy-web/src/queries/useTemplateQuery.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { QueryKey, useMutation, useQuery, useQueryClient, UseQueryOptions, UseQueryResult } from "react-query";
import type { TemplateCategory, TemplateOutputSummary } from "@akashnetwork/http-sdk";
import { Snackbar } from "@akashnetwork/ui/components";
import axios from "axios";
import { useRouter } from "next/navigation";
import { useSnackbar } from "notistack";
import { QueryKey, useMutation, useQuery, useQueryClient, UseQueryOptions, UseQueryResult } from "react-query";

import { useCustomUser } from "@src/hooks/useCustomUser";
import { services } from "@src/services/http/http-browser.service";
import { ITemplate } from "@src/types";
import { UrlService } from "@src/utils/urlUtils";
import { QueryKeys } from "./queryKeys";
import type { TemplateCategory, TemplateOutputSummary } from "@akashnetwork/http-sdk";

async function getUserTemplates(username: string): Promise<ITemplate[]> {
const response = await axios.get(`/api/proxy/user/templates/${username}`);
Expand Down Expand Up @@ -117,7 +117,7 @@ async function getTemplates() {
const modifiedCategories = categories.map(category => {
const templatesWithCategory = category.templates.map(template => ({
...template,
category: category.title,
category: category.title
}));

return { ...category, templates: templatesWithCategory };
Expand All @@ -127,12 +127,12 @@ async function getTemplates() {
return { categories: modifiedCategories, templates };
}

export interface EnhancedTemplateCategory extends Omit<TemplateCategory, 'templates'> {
export interface EnhancedTemplateCategory extends Omit<TemplateCategory, "templates"> {
templates: TemplateOutputSummaryWithCategory[];
}

export interface TemplateOutputSummaryWithCategory extends TemplateOutputSummary {
category: TemplateCategory['title']
export interface TemplateOutputSummaryWithCategory extends TemplateOutputSummary {
category: TemplateCategory["title"];
}

export interface CategoriesAndTemplates {
Expand Down
4 changes: 2 additions & 2 deletions apps/stats-web/src/components/graph/Graph.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";
import React, { useEffect, useMemo, useRef, useState } from "react";
import React, { useEffect, useMemo, useRef } from "react";
import { useIntl } from "react-intl";
import { format } from "date-fns";
import { createChart } from "lightweight-charts";
import { useTheme } from "next-themes";

import { customColors } from "@/lib/colors";
import { nFormatter, roundDecimal } from "@/lib/mathHelpers";
import { GraphResponse, ISnapshotMetadata, ProviderSnapshots, Snapshots, SnapshotValue } from "@/types";
import { GraphResponse, ISnapshotMetadata, SnapshotValue } from "@/types";

interface IGraphProps {
rangedData: SnapshotValue[];
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
module.exports = { extends: ["@commitlint/config-conventional"] };
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"npm run lint:fix",
"npm run format"
"eslint --fix",
"prettier --write"
],
"package.json": [
"node_modules/.bin/sort-package-json"
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-config/.eslintrc.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
plugins: ["simple-import-sort"],
ignorePatterns: ["node_modules", "dist", "build", "public", "Leap"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true, argsIgnorePattern: "^_" }],
"simple-import-sort/imports": [
"error",
{
Expand Down
1 change: 1 addition & 0 deletions packages/http-sdk/src/block/block-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class BlockHttpService extends HttpService {

async getCurrentHeight() {
const response = this.extractData(await this.get<BlockResponse>("blocks/latest"));

return parseInt(response.block.header.height);
}
}

0 comments on commit 1115a60

Please sign in to comment.