Skip to content

Commit

Permalink
chore: useImport type rule (#400)
Browse files Browse the repository at this point in the history
* chore: useImport type rule

* fix: single type imports
  • Loading branch information
alicanerdurmaz authored May 31, 2024
1 parent a9c6adc commit 3f2f447
Show file tree
Hide file tree
Showing 47 changed files with 68 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { PropsWithChildren } from "react";
import type { PropsWithChildren } from "react";
import { Breadcrumb } from "../breadcrumb";
import { Menu } from "../menu";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord, useMany } from "@refinedev/core";
import { type BaseRecord, useMany } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord } from "@refinedev/core";
import type { BaseRecord } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React, {
PropsWithChildren,
type PropsWithChildren,
createContext,
useEffect,
useState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React from "react";
import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar";
import { SessionProvider, useSession, signOut, signIn } from "next-auth/react";
import { usePathname } from 'next/navigation'
Expand Down Expand Up @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
return <span>loading...</span>;
}

const authProvider: AuthBindings = {
const authProvider: AuthProvider = {
login: async () => {
signIn("auth0", {
callbackUrl: to ? to.toString() : "/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from "next";
import type { Metadata } from "next";
<%- (_app.nextjsImport || []).join("\n") _%>
import React, { Suspense } from "react";
import { RefineContext } from "./_refine_context";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { cookies } from "next/headers";

export const authProviderServer: Pick<AuthBindings, "check"> = {
export const authProviderServer: Pick<AuthProvider, "check"> = {
check: async () => {
const cookieStore = cookies();
const auth = cookieStore.get("auth");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import Cookies from "js-cookie";

const mockUsers = [
Expand All @@ -18,7 +18,7 @@ const mockUsers = [
},
];

export const authProvider: AuthBindings = {
export const authProvider: AuthProvider = {
login: async ({ email, username, password, remember }) => {
// Suppose we actually send a request to the back end here.
const user = mockUsers[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React from "react";
import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar";
import { SessionProvider, useSession, signOut, signIn } from "next-auth/react";
import { usePathname } from 'next/navigation'
Expand Down Expand Up @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
return <span>loading...</span>;
}

const authProvider: AuthBindings = {
const authProvider: AuthProvider = {
login: async () => {
signIn("google", {
callbackUrl: to ? to.toString() : "/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from "next";
import type { Metadata } from "next";
<%- (_app.nextjsImport || []).join("\n") _%>
import React, { Suspense } from "react";
import { RefineContext } from "./_refine_context";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React from "react";
import { Refine, GitHubBanner, AuthBindings, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { Refine, GitHubBanner, type AuthProvider, <%- (_app.refineImports || []).join("\n,") _%> } from '@refinedev/core';
import { RefineKbar, RefineKbarProvider } from "@refinedev/kbar";
import { SessionProvider, useSession, signOut, signIn } from "next-auth/react";
import { usePathname } from 'next/navigation'
Expand Down Expand Up @@ -59,7 +59,7 @@ const App = (props: React.PropsWithChildren<AppProps>) => {
return <span>loading...</span>;
}

const authProvider: AuthBindings = {
const authProvider: AuthProvider = {
login: async () => {
signIn("keycloak", {
callbackUrl: to ? to.toString() : "/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Metadata } from "next";
import type { Metadata } from "next";
<%- (_app.nextjsImport || []).join("\n") _%>
import React, { Suspense } from "react";
import { RefineContext } from "./_refine_context";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { AppwriteException } from "@refinedev/appwrite";
import { AuthProvider } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { appwriteAccount, appwriteClient } from "@utils/appwrite/client";
import { APPWRITE_JWT_KEY } from "@utils/constants";
import Cookies from "js-cookie";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthProvider } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { getSessionClient } from "@utils/appwrite/server";

export const authProviderServer: Pick<AuthProvider, "check"> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthProvider } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { API_URL, TOKEN_KEY } from "@utility/constants";
import { cookies } from "next/headers";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { AuthHelper } from "@refinedev/strapi-v4";
import { axiosInstance } from "@utility/axios-instance";
import { API_URL, TOKEN_KEY } from "@utility/constants";
import Cookies from "js-cookie";

const strapiAuthHelper = AuthHelper(API_URL + "/api");

export const authProvider: AuthBindings = {
export const authProvider: AuthProvider = {
login: async ({ email, password }) => {
const { data, status } = await strapiAuthHelper.login(email, password);
if (status === 200) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CookieOptions, createServerClient } from "@supabase/ssr";
import { NextRequest, NextResponse } from "next/server";
import { type CookieOptions, createServerClient } from "@supabase/ssr";
import { type NextRequest, NextResponse } from "next/server";
import { SUPABASE_KEY, SUPABASE_URL } from "./constants";

export async function updateSession(request: NextRequest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { DataGrid, type GridColDef } from "@mui/x-data-grid";
import { useMany } from "@refinedev/core";
import {
DateField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { DataGrid, type GridColDef } from "@mui/x-data-grid";
import {
DeleteButton,
EditButton,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import React, {
PropsWithChildren,
type PropsWithChildren,
createContext,
useEffect,
useState,
Expand Down
2 changes: 1 addition & 1 deletion refine-remix/plugins/_base/app/components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren } from "react";
import type { PropsWithChildren } from "react";
import { Breadcrumb } from "../breadcrumb";
import { Menu } from "../menu";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord, useMany } from "@refinedev/core";
import { type BaseRecord, useMany } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord } from "@refinedev/core";
import type { BaseRecord } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Outlet } from "@remix-run/react";
import { LoaderFunctionArgs, redirect } from "@remix-run/node";
import { type LoaderFunctionArgs, redirect } from "@remix-run/node";
import { authenticator } from "~/utils/auth.server";

export default function AuthLayout() {
Expand Down
4 changes: 2 additions & 2 deletions refine-remix/plugins/auth-provider-custom/app/authProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import * as cookie from "cookie";
import Cookies from "js-cookie";

Expand All @@ -25,7 +25,7 @@ const mockUsers = [

const COOKIE_NAME = "user";

export const authProvider: AuthBindings = {
export const authProvider: AuthProvider = {
login: async ({ email }) => {
// Suppose we actually send a request to the back end here.
const user = mockUsers.find((item) => item.email === email);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Outlet } from "@remix-run/react";
import { LoaderFunctionArgs, redirect } from "@remix-run/node";
import { type LoaderFunctionArgs, redirect } from "@remix-run/node";
import { authenticator } from "~/utils/auth.server";

export default function AuthLayout() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Outlet } from "@remix-run/react";
import { LoaderFunctionArgs, redirect } from "@remix-run/node";
import { type LoaderFunctionArgs, redirect } from "@remix-run/node";
import { authenticator } from "~/utils/auth.server";

export default function AuthLayout() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AppwriteException } from "@refinedev/appwrite";
import { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import * as cookie from "cookie";
import Cookies from "js-cookie";
import { v4 as uuidv4 } from "uuid";
import { account, appwriteClient, TOKEN_KEY } from "./utility";

export const authProvider: AuthBindings = {
export const authProvider: AuthProvider = {
login: async ({ email, password }) => {
try {
await account.createEmailSession(email, password);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AuthBindings } from "@refinedev/core";
import type { AuthProvider } from "@refinedev/core";
import { AuthHelper } from "@refinedev/strapi-v4";
import axios from "axios";
import * as cookie from "cookie";
Expand All @@ -16,7 +16,7 @@ axiosInstance.interceptors.request.use((config) => {
return config;
});

export const authProvider: AuthBindings = {
export const authProvider: AuthProvider = {
login: async ({ email, password }) => {
const { data, status } = await strapiAuthHelper.login(email, password);
if (status === 200) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
GetManyResponse,
type GetManyResponse,
useMany,
useNavigation,
} from "@refinedev/core";
import { useTable } from "@refinedev/react-table";
import { ColumnDef, flexRender } from "@tanstack/react-table";
import { type ColumnDef, flexRender } from "@tanstack/react-table";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
import { BLOG_POSTS_QUERY } from "../queries/blog-posts";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useNavigation } from "@refinedev/core";
import { useTable } from "@refinedev/react-table";
import { ColumnDef, flexRender } from "@tanstack/react-table";
import { type ColumnDef, flexRender } from "@tanstack/react-table";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
import { CATEGORIES_QUERY } from "../queries/categories";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { DataGrid, type GridColDef } from "@mui/x-data-grid";
import { useMany } from "@refinedev/core";
import {
DateField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataGrid, GridColDef } from "@mui/x-data-grid";
import { DataGrid, type GridColDef } from "@mui/x-data-grid";
import {
DeleteButton,
EditButton,
Expand Down
2 changes: 1 addition & 1 deletion refine-remix/plugins/mui/app/components/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Stack from "@mui/material/Stack";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import { useGetIdentity } from "@refinedev/core";
import { HamburgerMenu, RefineThemedLayoutV2HeaderProps } from "@refinedev/mui";
import { HamburgerMenu, type RefineThemedLayoutV2HeaderProps } from "@refinedev/mui";
import React, { useContext } from "react";
import { ColorModeContext } from "~/contexts/ColorModeContext";

Expand Down
2 changes: 1 addition & 1 deletion refine-vite/plugins/_base/src/components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren } from "react";
import type { PropsWithChildren } from "react";
import { Breadcrumb } from "../breadcrumb";
import { Menu } from "../menu";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord, useMany } from "@refinedev/core";
import { type BaseRecord, useMany } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ShowButton,
useTable,
} from "@refinedev/antd";
import { BaseRecord } from "@refinedev/core";
import type { BaseRecord } from "@refinedev/core";
import { Space, Table } from "antd";
import React from "react";
<%_ if (answers["data-provider"] === "data-provider-hasura") { _%>
Expand Down
2 changes: 1 addition & 1 deletion refine-vite/plugins/antd/src/contexts/color-mode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren, createContext, useEffect, useState } from "react";
import { type PropsWithChildren, createContext, useEffect, useState } from "react";
import { ConfigProvider, theme } from "antd";
import { RefineThemes } from "@refinedev/antd";

Expand Down
Loading

0 comments on commit 3f2f447

Please sign in to comment.