Skip to content

Commit

Permalink
Lint: autofix to new import order
Browse files Browse the repository at this point in the history
  • Loading branch information
stscoundrel committed Aug 6, 2023
1 parent ec0a82d commit 11ea1e3
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/components/Abbreviations/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link'
import AbbreviationList from 'components/AbbreviationList'
import { CombinedAbbreviations } from 'lib/services/abbreviations'
import Link from 'next/link'
import styles from './Abbreviations.module.scss'

interface AbbreviationProps{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumbs/index.js
Original file line number Diff line number Diff line change
@@ -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 }) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Crosslinks/Crosslinks.test.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion src/components/Head/Head.test.js
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Layout.test.js
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchResults/SearchTeaser/index.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SimilarEntries/SimilarEntries.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DictionaryEntry } from 'lib/services/dictionary'
import renderer from 'react-test-renderer'
import { DictionaryEntry } from 'lib/services/dictionary'
import SimilarEntries from './index'

describe('Similar entries component', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/WordDefinition/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { capitalize, getOlderSpelling } from 'lib/utils/strings'
import { lettersToRunes } from 'younger-futhark'
import { Crosslink } from 'scandinavian-dictionary-crosslinker'
import { capitalize, getOlderSpelling } from 'lib/utils/strings'
import { addAbbreviationsToContent, CombinedAbbreviations } from 'lib/services/abbreviations'
import Abbreviations from 'components/Abbreviations'
import { DictionaryEntry } from 'lib/services/dictionary'
import { Crosslink } from 'scandinavian-dictionary-crosslinker'
import Crosslinks from 'components/Crosslinks'
import SimilarEntries from 'components/SimilarEntries'
import styles from './WordDefinition.module.scss'
Expand Down
2 changes: 1 addition & 1 deletion src/components/WordList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DictionaryEntry } from 'cleasby-vigfusson-dictionary'
import { hasProperty } from 'spyrjari'
import WordLink from 'components/WordLink'
import { DictionaryEntryDTO } from 'lib/services/dictionary'
import { hasProperty } from 'spyrjari'
import styles from './WordList.module.scss'

interface WordListProps {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/search.ts
Original file line number Diff line number Diff line change
@@ -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 default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (!req.query.search || !req.query.criteria) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Services.
import Link from 'next/link'
import {
getRandomEntries, getAlphabet, DictionaryEntry, AlphabetLetter,
} from 'lib/services/dictionary'

// Components.
import Layout from 'components/Layout'
import ContentArea from 'components/ContentArea'
import Link from 'next/link'
import WordList from 'components/WordList'
import SampleText from 'components/SampleText'

Expand Down
2 changes: 1 addition & 1 deletion src/pages/sitemap-creator.xml.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Services.
import { getSitemapContent, formatSitemap } from 'lib/services/sitemap'
import { SitemapStream, streamToPromise } from 'sitemap'
import { getSitemapContent, formatSitemap } from 'lib/services/sitemap'

export async function getServerSideProps({ res }) {
const content = getSitemapContent()
Expand Down
2 changes: 1 addition & 1 deletion src/pages/word/[word].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useRouter } from 'next/router'

// Services.
import { Crosslink } from 'scandinavian-dictionary-crosslinker'
import {
getWord, getAlphabet, DictionaryEntry, AlphabetLetter, getSimilarWords,
} from 'lib/services/dictionary'
Expand All @@ -13,7 +14,6 @@ import { redirect404, Redirect404ResponseSchema } from 'lib/utils/redirect-404'
import Layout from 'components/Layout'
import WordDefinition from 'components/WordDefinition'
import Button from 'components/Button'
import { Crosslink } from 'scandinavian-dictionary-crosslinker'
import { decodeLetter } from 'lib/utils/slugs'
import { getCrossLinks } from 'lib/services/crosslinks'

Expand Down
7 changes: 3 additions & 4 deletions tests/unit/lib/services/abbreviations.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Test utils.
import { isObject, isArray } from 'volva'
import { hasProperty } from 'spyrjari'
import {
getAbbreviations,
addAbbreviationsToContent,
} from 'lib/services/abbreviations'

// Test utils.
import { isObject, isArray } from 'volva'
import { hasProperty } from 'spyrjari'

describe('Abbreviations tests', () => {
const simpleEntry = {
word: 'hval-reið',
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/lib/services/dictionary.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getDictionary } from 'cleasby-vigfusson-dictionary'
import {
getAllWords, getByLetter, getWord, getAlphabet, getSimilarWords,
} from 'lib/services/dictionary'
import { isArray } from 'volva'
import { matchesSchema } from 'jafningjar'
import { oldNorseSort } from 'old-norse-alphabet-sort'
import {
getAllWords, getByLetter, getWord, getAlphabet, getSimilarWords,
} from 'lib/services/dictionary'

describe('Dictionary tests', () => {
const dictionary = getAllWords()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/lib/services/search.test.js
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lib/services/sitemap.test.js
Original file line number Diff line number Diff line change
@@ -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://cleasbyvigfusson.test'
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pages/404.test.js
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ReactDOM from 'react-dom/client'
import Index, { getStaticProps } from 'pages/index'
import renderer from 'react-test-renderer'
import { getAllWords, getAlphabet } from 'lib/services/dictionary'
import { matchesSchema } from 'jafningjar'
import Index, { getStaticProps } from 'pages/index'
import { getAllWords, getAlphabet } from 'lib/services/dictionary'

describe('Index page', () => {
test('Does not crash', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pages/letter.test.js
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pages/search.test.tsx
Original file line number Diff line number Diff line change
@@ -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'

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pages/sitemap-creator.xml.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ReactDOM from 'react-dom/client'
import Sitemap, { getServerSideProps } from 'pages/sitemap-creator.xml'
import renderer from 'react-test-renderer'
import { createMocks } from 'node-mocks-http'
import Sitemap, { getServerSideProps } from 'pages/sitemap-creator.xml'

describe('Sitemap page: render', () => {
process.env.NEXT_PUBLIC_SITE_URL = 'https://cleasbyvigfusson.test'
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/pages/sources.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ReactDOM from 'react-dom/client'
import Sources, { getStaticProps } from 'pages/source-list'
import renderer from 'react-test-renderer'
import Sources, { getStaticProps } from 'pages/source-list'
import { getAlphabet } from 'lib/services/dictionary'
import { getAllSorces } from 'lib/services/abbreviations'

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/pages/word.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ReactDOM from 'react-dom/client'
import Word, { getStaticProps, getStaticPaths } from 'pages/word/[word]'
import renderer from 'react-test-renderer'
import { getAlphabet } from 'lib/services/dictionary'
import { DictionarySource } from 'scandinavian-dictionary-crosslinker'
import Word, { getStaticProps, getStaticPaths } from 'pages/word/[word]'
import { getAlphabet } from 'lib/services/dictionary'

const mockHandler = jest.fn()

Expand Down

0 comments on commit 11ea1e3

Please sign in to comment.