From 6ab44032ac105e33c3e26ed54d64e497af966267 Mon Sep 17 00:00:00 2001 From: Sampo Silvennoinen Date: Sun, 6 Aug 2023 15:23:19 +0300 Subject: [PATCH] Lint: autofix to new import order --- src/components/Breadcrumbs/index.js | 2 +- src/components/Crosslinks/Crosslinks.test.tsx | 2 +- src/components/Footer/Footer.test.js | 2 +- src/components/Head/Head.test.js | 2 +- src/components/Layout/Layout.test.js | 2 +- src/components/SearchResults/SearchTeaser/index.tsx | 2 +- src/components/WordDefinition/index.js | 2 +- src/pages/api/search.ts | 2 +- src/pages/api/sitemap.ts | 2 +- src/pages/index.tsx | 2 +- tests/unit/lib/services/dictionary.test.ts | 4 ++-- tests/unit/lib/services/search.test.ts | 4 ++-- tests/unit/lib/services/sitemap.test.js | 2 +- tests/unit/pages/404.test.tsx | 2 +- tests/unit/pages/index.test.tsx | 4 ++-- tests/unit/pages/letter.test.tsx | 2 +- tests/unit/pages/search.test.tsx | 2 +- tests/unit/pages/word.test.tsx | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/Breadcrumbs/index.js b/src/components/Breadcrumbs/index.js index ecdf8fa..d7051d2 100644 --- a/src/components/Breadcrumbs/index.js +++ b/src/components/Breadcrumbs/index.js @@ -1,6 +1,6 @@ +import Link from 'next/link' import { getBreadcrumbs } from 'lib/utils/breadcrumbs' import { getSchema } from 'lib/utils/schema' -import Link from 'next/link' import styles from './Breadcrumbs.module.scss' export default function Breadcrumbs({ type, content }) { diff --git a/src/components/Crosslinks/Crosslinks.test.tsx b/src/components/Crosslinks/Crosslinks.test.tsx index 39c2a80..ca3471d 100644 --- a/src/components/Crosslinks/Crosslinks.test.tsx +++ b/src/components/Crosslinks/Crosslinks.test.tsx @@ -1,6 +1,6 @@ import renderer from 'react-test-renderer' -import { Crosslink } from 'lib/services/crosslinks' import { DictionarySource } from 'scandinavian-dictionary-crosslinker' +import { Crosslink } from 'lib/services/crosslinks' import Crosslinks from './index' import styles from './Crosslinks.module.scss' diff --git a/src/components/Footer/Footer.test.js b/src/components/Footer/Footer.test.js index 430668a..93a5cfc 100644 --- a/src/components/Footer/Footer.test.js +++ b/src/components/Footer/Footer.test.js @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Footer from 'components/Footer' import renderer from 'react-test-renderer' +import Footer from 'components/Footer' const letters = [ { diff --git a/src/components/Head/Head.test.js b/src/components/Head/Head.test.js index 4e63aaa..6a8fee6 100644 --- a/src/components/Head/Head.test.js +++ b/src/components/Head/Head.test.js @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Head from 'components/Head' import renderer from 'react-test-renderer' +import Head from 'components/Head' import { getByLetter, getWord } from 'lib/services/dictionary' describe('Head component', () => { diff --git a/src/components/Layout/Layout.test.js b/src/components/Layout/Layout.test.js index d01dcee..a463d1c 100644 --- a/src/components/Layout/Layout.test.js +++ b/src/components/Layout/Layout.test.js @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Layout from 'components/Layout' import renderer from 'react-test-renderer' +import Layout from 'components/Layout' import { getByLetter, getWord, getAlphabet } from 'lib/services/dictionary' describe('Layout component', () => { diff --git a/src/components/SearchResults/SearchTeaser/index.tsx b/src/components/SearchResults/SearchTeaser/index.tsx index ad0406f..d809ac3 100644 --- a/src/components/SearchResults/SearchTeaser/index.tsx +++ b/src/components/SearchResults/SearchTeaser/index.tsx @@ -1,5 +1,5 @@ -import { SearchResult } from 'lib/services/search' import Link from 'next/link' +import { SearchResult } from 'lib/services/search' import styles from './SearchTeaser.module.scss' interface SearchTeaserProps { diff --git a/src/components/WordDefinition/index.js b/src/components/WordDefinition/index.js index 033f98e..82a98d4 100644 --- a/src/components/WordDefinition/index.js +++ b/src/components/WordDefinition/index.js @@ -1,5 +1,5 @@ -import { capitalize } from 'lib/utils/strings' import { lettersToRunes } from 'younger-futhark' +import { capitalize } from 'lib/utils/strings' import { addAbbreviationsToContent } from 'lib/services/abbreviations' import Abbreviations from 'components/Abbreviations' import Crosslinks from 'components/Crosslinks' diff --git a/src/pages/api/search.ts b/src/pages/api/search.ts index 1e875d5..95c5fb7 100644 --- a/src/pages/api/search.ts +++ b/src/pages/api/search.ts @@ -1,6 +1,6 @@ +import { NextApiRequest, NextApiResponse } from 'next'; import { getAllWords } from 'lib/services/dictionary' import { Criteria, searchDictionary } from 'lib/services/search'; -import { NextApiRequest, NextApiResponse } from 'next'; export const config = { api: { diff --git a/src/pages/api/sitemap.ts b/src/pages/api/sitemap.ts index 2bdf105..3a43922 100644 --- a/src/pages/api/sitemap.ts +++ b/src/pages/api/sitemap.ts @@ -1,6 +1,6 @@ import type { NextApiRequest, NextApiResponse } from 'next' -import { getSitemapContent, formatSitemap } from 'lib/services/sitemap' import { SitemapStream, streamToPromise } from 'sitemap' +import { getSitemapContent, formatSitemap } from 'lib/services/sitemap' export default async (req: NextApiRequest, res: NextApiResponse) => { const content = getSitemapContent() diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 242dd9b..3187700 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,10 +1,10 @@ // Services. +import Link from 'next/link' import { AlphabetLetter, getAlphabet } from 'lib/services/dictionary' // Components. import Layout from 'components/Layout' import ContentArea from 'components/ContentArea' -import Link from 'next/link' import SampleText from 'components/SampleText' interface IndexProps { diff --git a/tests/unit/lib/services/dictionary.test.ts b/tests/unit/lib/services/dictionary.test.ts index 197cee7..bc4b003 100644 --- a/tests/unit/lib/services/dictionary.test.ts +++ b/tests/unit/lib/services/dictionary.test.ts @@ -1,9 +1,9 @@ import { getDictionary } from 'old-icelandic-zoega' +import { isArray } from 'volva' +import { matchesSchema } from 'jafningjar' import { getAllWords, getByLetter, getWord, getAlphabet, } from 'lib/services/dictionary' -import { isArray } from 'volva' -import { matchesSchema } from 'jafningjar' describe('Dictionary tests', () => { const dictionary = getAllWords() diff --git a/tests/unit/lib/services/search.test.ts b/tests/unit/lib/services/search.test.ts index 455961b..29538ad 100644 --- a/tests/unit/lib/services/search.test.ts +++ b/tests/unit/lib/services/search.test.ts @@ -1,7 +1,7 @@ -import { getAllWords } from 'lib/services/dictionary' -import { searchDictionary } from 'lib/services/search' import { isArray } from 'volva' import { hasProperty } from 'spyrjari' +import { getAllWords } from 'lib/services/dictionary' +import { searchDictionary } from 'lib/services/search' describe('Search tests', () => { const dictionary = getAllWords() diff --git a/tests/unit/lib/services/sitemap.test.js b/tests/unit/lib/services/sitemap.test.js index 99208b5..40f733c 100644 --- a/tests/unit/lib/services/sitemap.test.js +++ b/tests/unit/lib/services/sitemap.test.js @@ -1,7 +1,7 @@ -import { getSitemapContent, formatSitemap } from 'lib/services/sitemap' import { SitemapStream, streamToPromise } from 'sitemap' import { hasProperty } from 'spyrjari' import { isArray } from 'volva' +import { getSitemapContent, formatSitemap } from 'lib/services/sitemap' describe('Sitemap tests', () => { process.env.NEXT_PUBLIC_SITE_URL = 'https://oldicelandic.test' diff --git a/tests/unit/pages/404.test.tsx b/tests/unit/pages/404.test.tsx index 8a3ad54..a74917f 100644 --- a/tests/unit/pages/404.test.tsx +++ b/tests/unit/pages/404.test.tsx @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Page404, { getStaticProps } from 'pages/404' import renderer from 'react-test-renderer' +import Page404, { getStaticProps } from 'pages/404' import { getAlphabet } from 'lib/services/dictionary' describe('404 page page', () => { diff --git a/tests/unit/pages/index.test.tsx b/tests/unit/pages/index.test.tsx index f7ecb07..34e0449 100644 --- a/tests/unit/pages/index.test.tsx +++ b/tests/unit/pages/index.test.tsx @@ -1,8 +1,8 @@ import ReactDOM from 'react-dom/client' -import Index, { getStaticProps } from 'pages/index' import renderer from 'react-test-renderer' -import { getAlphabet } from 'lib/services/dictionary' import { matchesSchema } from 'jafningjar' +import Index, { getStaticProps } from 'pages/index' +import { getAlphabet } from 'lib/services/dictionary' describe('Index page', () => { test('Does not crash', () => { diff --git a/tests/unit/pages/letter.test.tsx b/tests/unit/pages/letter.test.tsx index 25fc30a..0a229d2 100644 --- a/tests/unit/pages/letter.test.tsx +++ b/tests/unit/pages/letter.test.tsx @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Letter, { getStaticProps, getStaticPaths } from 'pages/letter/[letter]' import renderer from 'react-test-renderer' +import Letter, { getStaticProps, getStaticPaths } from 'pages/letter/[letter]' import { getByLetter, getAlphabet } from 'lib/services/dictionary' describe('Letter page: render', () => { diff --git a/tests/unit/pages/search.test.tsx b/tests/unit/pages/search.test.tsx index 940ea4b..14a9d08 100644 --- a/tests/unit/pages/search.test.tsx +++ b/tests/unit/pages/search.test.tsx @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Search, { getStaticProps } from 'pages/search' import renderer from 'react-test-renderer' +import Search, { getStaticProps } from 'pages/search' import { getAlphabet } from 'lib/services/dictionary' /** diff --git a/tests/unit/pages/word.test.tsx b/tests/unit/pages/word.test.tsx index f4e3cfb..9f6fc6c 100644 --- a/tests/unit/pages/word.test.tsx +++ b/tests/unit/pages/word.test.tsx @@ -1,6 +1,6 @@ import ReactDOM from 'react-dom/client' -import Word, { getStaticProps, getStaticPaths } from 'pages/word/[word]' import renderer from 'react-test-renderer' +import Word, { getStaticProps, getStaticPaths } from 'pages/word/[word]' import { getAlphabet } from 'lib/services/dictionary' const mockHandler = jest.fn()