restore prettier-plugin-sort-imports functionality

This commit is contained in:
Matthias Kretschmann 2024-01-30 21:41:04 +00:00
parent 7e08114c9e
commit c233eccddf
Signed by: m
GPG Key ID: 606EEEF3C479A91F
12 changed files with 21 additions and 22 deletions

View File

@ -4,6 +4,7 @@
"trailingComma": "none",
"tabWidth": 2,
"endOfLine": "lf",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
@ -11,8 +12,5 @@
"^[./]"
],
"importOrderSeparation": false,
"importOrderSortSpecifiers": true,
"importOrderBuiltinModulesToTop": true,
"importOrderMergeDuplicateImports": true,
"importOrderCombineTypeAndValueImports": true
"importOrderSortSpecifiers": true
}

View File

@ -1,4 +1,5 @@
import { Metadata, ResolvingMetadata } from 'next'
import { notFound } from 'next/navigation'
import meta from '../../../_content/meta.json'
import Project from '../../components/Project'
import ProjectNav from '../../components/ProjectNav'
@ -7,7 +8,6 @@ import {
getProjectBySlug,
getProjectSlugs
} from '../../lib/content'
import { notFound } from 'next/navigation'
type Props = {
params: { slug: string }

View File

@ -1,8 +1,8 @@
import { render } from '@testing-library/react'
import Page, { generateMetadata, generateStaticParams } from '../[slug]/page'
import projectsMock from '../../../tests/__fixtures__/projects.json'
import projectMock from '../../../tests/__fixtures__/project.json'
import meta from '../../../_content/meta.json'
import projectMock from '../../../tests/__fixtures__/project.json'
import projectsMock from '../../../tests/__fixtures__/projects.json'
import Page, { generateMetadata, generateStaticParams } from '../[slug]/page'
jest.mock('../../lib/content', () => ({
getAllProjects: jest.fn().mockImplementation(() => projectsMock),

View File

@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react'
import Page from '../not-found'
import mockData from '../../../tests/__fixtures__/giphy.json'
import Page from '../not-found'
describe('app: /not-found', () => {
it('renders correctly', async () => {

View File

@ -1,7 +1,7 @@
import { render } from '@testing-library/react'
import Page from '../page'
import projectsMock from '../../../tests/__fixtures__/projects.json'
import reposMock from '../../../tests/__fixtures__/repos.json'
import Page from '../page'
jest.mock('../../lib/content', () => ({
getAllProjects: jest.fn().mockImplementationOnce(() => projectsMock)

View File

@ -1,7 +1,7 @@
'use server'
import { GiphyFetch } from '@giphy/js-fetch-api'
import { revalidatePath } from 'next/cache'
import { GiphyFetch } from '@giphy/js-fetch-api'
export async function getLocation() {
try {

View File

@ -1,5 +1,4 @@
import '../styles/global.css'
import { Providers } from './providers'
import { Metadata, Viewport } from 'next'
import Script from 'next/script'
import meta from '../../_content/meta.json'
import resume from '../../_content/resume.json'
@ -8,8 +7,9 @@ import Header from '../components/Header'
import HostnameCheck from '../components/HostnameCheck'
import ThemeSwitch from '../components/ThemeSwitch'
import { UMAMI_SCRIPT_URL, UMAMI_WEBSITE_ID } from '../lib/umami'
import '../styles/global.css'
import styles from '../styles/layout.module.css'
import { Metadata, Viewport } from 'next'
import { Providers } from './providers'
const isProduction = process.env.NODE_ENV === 'production'

View File

@ -10,7 +10,8 @@
display: block;
width: auto;
height: 300px;
box-shadow: 0 3px 5px rgba(var(--brand-main), 0.15),
box-shadow:
0 3px 5px rgba(var(--brand-main), 0.15),
0 5px 16px rgba(var(--brand-main), 0.15);
margin: calc(var(--spacer) / 4) auto calc(var(--spacer) / 2) auto;
}

View File

@ -2,10 +2,10 @@
import { MouseEvent, useEffect, useState } from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { getRandomGif } from '../../app/actions'
import Button from '../Button'
import styles from './index.module.css'
import { getRandomGif } from '../../app/actions'
import { usePathname } from 'next/navigation'
const tag = 'cat'

View File

@ -1,11 +1,11 @@
'use client'
import { usePathname } from 'next/navigation'
import Availability from '../Availability'
import Location from '../Location'
import LogoUnit from '../LogoUnit'
import Networks from '../Networks'
import Location from '../Location'
import styles from './index.module.css'
import { usePathname } from 'next/navigation'
export default function Header() {
const pathname = usePathname()

View File

@ -1,12 +1,12 @@
'use client'
import { useEffect, useState } from 'react'
import RelativeTime from '@yaireo/relative-time'
import { LazyMotion, domAnimation, m, useReducedMotion } from 'framer-motion'
import { getLocation } from '../../app/actions'
import { getAnimationProps, moveInTop } from '../Transitions'
import { Flag } from './Flag'
import styles from './index.module.css'
import { useEffect, useState } from 'react'
import { getLocation } from '../../app/actions'
import { UseLocation } from './types'
export default function Location() {

View File

@ -1,11 +1,11 @@
'use client'
import { useEffect, useState } from 'react'
import * as Select from '@radix-ui/react-select'
import { useTheme } from 'next-themes'
import Icon from '../Icon'
import { Item } from './Item'
import styles from './index.module.css'
import { useEffect, useState } from 'react'
export function getIconName(theme: string) {
return theme === 'light' ? 'Sun' : theme === 'dark' ? 'Moon' : 'Contrast'