Skip to content

Commit

Permalink
chore: formated all files from pre pre-commit formating
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Jan 20, 2024
1 parent 7729c99 commit 6418185
Show file tree
Hide file tree
Showing 23 changed files with 58 additions and 68 deletions.
30 changes: 15 additions & 15 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/** @type {import("eslint").Linter.Config} */
const config = {
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
plugins: ["@typescript-eslint"],
plugins: ['@typescript-eslint'],
extends: [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
rules: {
// These opinionated rules are enabled in stylistic-type-checked above.
// Feel free to reconfigure them to your own preference.
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',

"@typescript-eslint/consistent-type-imports": [
"warn",
'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: { attributes: false },
},
Expand Down
2 changes: 1 addition & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Use type safe message keys with `next-intl`
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
type Messages = typeof import("./messages/en.json");
type Messages = typeof import('./messages/en.json');
// eslint-disable-next-line @typescript-eslint/no-empty-interface
declare interface IntlMessages extends Messages {}
6 changes: 3 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import nextIntl from "next-intl/plugin";
import nextIntl from 'next-intl/plugin';

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");
const withNextIntl = nextIntl("./src/i18n.ts");
await import('./src/env.js');
const withNextIntl = nextIntl('./src/i18n.ts');

/** @type {import("next").NextConfig} */
const config = {};
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
},
"lint-staged": {
"*.{js,cjs,ts,tsx}": [
"next lint --fix",
"prettier --write",
"tsc --noEmit"
"eslint --fix",
"prettier --write"
]
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions src/app/[locale]/(layout)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { unstable_setRequestLocale } from "next-intl/server";
import { type ReactNode } from "react";
import { unstable_setRequestLocale } from 'next-intl/server';
import { type ReactNode } from 'react';

import { Footer } from "@/components/layout/Footer";
import { Header } from "@/components/layout/Header";
import { Main } from "@/components/layout/Main";
import { Footer } from '@/components/layout/Footer';
import { Header } from '@/components/layout/Header';
import { Main } from '@/components/layout/Main';

export default function Dashboardlayout({
children,
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/[...rest]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { notFound } from "next/navigation";
import { notFound } from 'next/navigation';

export default function CatchAllPage() {
notFound();
Expand Down
1 change: 0 additions & 1 deletion src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getTranslations, unstable_setRequestLocale } from 'next-intl/server';
import { Inter, Montserrat } from 'next/font/google';
import { notFound } from 'next/navigation';

import { type ReactNode } from 'react';

import { locales } from '@/lib/config';
Expand Down
6 changes: 3 additions & 3 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
'use client';

import { redirect, usePathname } from "next/navigation";
import { redirect, usePathname } from 'next/navigation';

import { defaultLocale } from "@/lib/config";
import { defaultLocale } from '@/lib/config';

export default function NotFound() {
const pathname = usePathname();
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Footer() {
return (
<footer className='z-10 flex w-full justify-center border-t border-border/40 bg-background/95 px-11 py-10 md:px-16 lg:px-24'>
<div className='w-full max-w-screen-2xl text-sm'>
<div className='xs:grid-cols-2 grid grid-cols-1 gap-x-4 gap-y-12 sm:grid-cols-3 lg:grid-cols-4'>
<div className='grid grid-cols-1 gap-x-4 gap-y-12 xs:grid-cols-2 sm:grid-cols-3 lg:grid-cols-4'>
<div>
<LogoLink className='justify-start' />
<p className='ml-2 leading-tight'>
Expand All @@ -45,7 +45,7 @@ function Footer() {
</div>
<div>
<h4>{t('socialMedia')}</h4>
<ul className='grid-cols-2-auto sm:grid-cols-3-auto grid grid-flow-row justify-start text-foreground/80 xl:grid-flow-col xl:grid-cols-none'>
<ul className='grid grid-flow-row grid-cols-2-auto justify-start text-foreground/80 sm:grid-cols-3-auto xl:grid-flow-col xl:grid-cols-none'>
<li>
<Button asChild variant='ghost' size='sm-icon'>
<ExternalLink
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/MobileSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import { Menu } from 'lucide-react';

import * as React from 'react';

import { LogoLink } from '@/components/layout/LogoLink';
Expand Down
10 changes: 5 additions & 5 deletions src/components/providers/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";
'use client';

import { ThemeProvider } from "next-themes";
import { type ReactNode } from "react";
import { ThemeProvider } from 'next-themes';
import { type ReactNode } from 'react';

function NextThemeProvider({ children }: { children: ReactNode }) {
return (
<ThemeProvider
attribute="class"
defaultTheme="system"
attribute='class'
defaultTheme='system'
enableSystem
disableTransitionOnChange
>
Expand Down
1 change: 0 additions & 1 deletion src/components/settings/DarkModeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import { Moon, Sun } from 'lucide-react';
import { useTheme } from 'next-themes';

import * as React from 'react';

import { Button } from '@/components/ui/Button';
Expand Down
1 change: 0 additions & 1 deletion src/components/settings/LocaleMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import { Globe2 } from 'lucide-react';

import * as React from 'react';

import { flagIcons, locales } from '@/lib/config';
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Slot } from '@radix-ui/react-slot';

import * as React from 'react';

import { type VariantProps, cva } from '@/lib/utils';
Expand Down
3 changes: 2 additions & 1 deletion src/components/ui/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use client';

import { cx } from '@/lib/utils';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { Check, ChevronRight, Circle } from 'lucide-react';
import * as React from 'react';

import { cx } from '@/lib/utils';

const DropdownMenu = DropdownMenuPrimitive.Root;

const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/Separator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import * as SeparatorPrimitive from '@radix-ui/react-separator';

import * as React from 'react';

import { cx } from '@/lib/utils';
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/Sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import * as SheetPrimitive from '@radix-ui/react-dialog';
import { X } from 'lucide-react';

import * as React from 'react';

import { type VariantProps, cva, cx } from '@/lib/utils';
Expand Down
1 change: 0 additions & 1 deletion src/design/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Eye, EyeOff } from 'lucide-react';

import React, { useState } from 'react';

import { cx } from '@/lib/utils';
Expand Down
22 changes: 10 additions & 12 deletions src/design/TypeWriter.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState, useEffect } from 'react'
import { useEffect, useState } from 'react';

// TypeWriter Interface
interface TypeWriterProps {
className?: string,
text: string
delay: number
className?: string;
text: string;
delay: number;
}

// TypeWriter Function: Renders text as if it is being written out.
Expand All @@ -15,17 +15,15 @@ const TypeWriter: React.FC<TypeWriterProps> = ({ className, text, delay }) => {
useEffect(() => {
if (currentIndex < text.length) {
const timeout = setTimeout(() => {
setCurrentText(prevText => prevText + text[currentIndex]);
setCurrentIndex(prevIndex => prevIndex + 1);
setCurrentText((prevText) => prevText + text[currentIndex]);
setCurrentIndex((prevIndex) => prevIndex + 1);
}, delay);

return () => clearTimeout(timeout);
}
}, [currentIndex, delay, text]);

return (
<pre className={className}>{currentText}</pre>
)
}
return <pre className={className}>{currentText}</pre>;
};

export default TypeWriter
export default TypeWriter;
6 changes: 3 additions & 3 deletions src/env.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
import { createEnv } from '@t3-oss/env-nextjs';
import { z } from 'zod';

export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
NODE_ENV: z.enum(["development", "test", "production"]),
NODE_ENV: z.enum(['development', 'test', 'production']),
},

/**
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getRequestConfig } from "next-intl/server";
import { getRequestConfig } from 'next-intl/server';

export default getRequestConfig(async ({ locale }) => ({
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Expand Down
4 changes: 2 additions & 2 deletions src/lib/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createLocalizedPathnamesNavigation } from "next-intl/navigation";
import { createLocalizedPathnamesNavigation } from 'next-intl/navigation';

import { locales, localePrefix, pathnames } from "@/lib/config";
import { localePrefix, locales, pathnames } from '@/lib/config';

export const { Link, redirect, usePathname, useRouter, getPathname } =
createLocalizedPathnamesNavigation({ locales, localePrefix, pathnames });
6 changes: 3 additions & 3 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createMiddleware from "next-intl/middleware";
import createMiddleware from 'next-intl/middleware';

import { defaultLocale, localePrefix, locales, pathnames } from "@/lib/config";
import { defaultLocale, localePrefix, locales, pathnames } from '@/lib/config';

export default createMiddleware({
defaultLocale,
Expand All @@ -10,5 +10,5 @@ export default createMiddleware({
});

export const config = {
matcher: ["/", "/(en|no)/:path*", "/((?!api|_next|.*\\..*).*)"],
matcher: ['/', '/(en|no)/:path*', '/((?!api|_next|.*\\..*).*)'],
};

0 comments on commit 6418185

Please sign in to comment.