Skip to content

Commit 2f9f20d

Browse files
chore: prettier-plugin-sort-imports
1 parent 67d84a6 commit 2f9f20d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+254
-224
lines changed

.prettierrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@
77
"bracketSpacing": true,
88
"bracketSameLine": false,
99
"arrowParens": "always",
10-
"trailingComma": "none"
10+
"trailingComma": "none",
11+
"importOrder": [
12+
"^(react/(.*)$)|^(react$)|^(next/(.*)$)|^(next$)",
13+
"<THIRD_PARTY_MODULES>",
14+
"^(@/lib/(.*)$)|^(@/components/(.*)$)|^(@/styles/(.*)$)",
15+
"^[./]"
16+
],
17+
"importOrderSeparation": true,
18+
"importOrderSortSpecifiers": true,
19+
"importOrderGroupNamespaceSpecifiers": true
1120
}

examples/cra/src/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { NotionRenderer } from 'react-notion-x'
21
import { ExtendedRecordMap } from 'notion-types'
3-
2+
import { NotionRenderer } from 'react-notion-x'
43
import { Code } from 'react-notion-x/build/third-party/code'
54
import { Collection } from 'react-notion-x/build/third-party/collection'
65
import { Equation } from 'react-notion-x/build/third-party/equation'
7-
import { Pdf } from 'react-notion-x/build/third-party/pdf'
86
import { Modal } from 'react-notion-x/build/third-party/modal'
7+
import { Pdf } from 'react-notion-x/build/third-party/pdf'
98

109
import defaultRecordMap from './record-map.json'
1110

examples/cra/src/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
import * as React from 'react'
2-
import * as ReactDOM from 'react-dom'
3-
import App from './App'
42

3+
import * as ReactDOM from 'react-dom'
54
// core styles shared by all of react-notion-x (required)
65
import 'react-notion-x/src/styles.css'
76

7+
import App from './App'
88
// used for code syntax highlighting (optional)
99
// import 'prismjs/themes/prism-tomorrow.css'
10-
1110
// used for rendering equations (optional)
1211
// import 'katex/dist/katex.min.css'
13-
1412
import './index.css'
1513

1614
ReactDOM.render(

examples/full/components/Loading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
2-
import { LoadingIcon } from './LoadingIcon'
32

3+
import { LoadingIcon } from './LoadingIcon'
44
import styles from './styles.module.css'
55

66
export const Loading: React.FC = () => (

examples/full/components/LoadingIcon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as React from 'react'
2+
23
import cs from 'classnames'
4+
35
import styles from './styles.module.css'
46

57
export const LoadingIcon = (props) => {

examples/full/components/NotionPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as React from 'react'
2+
import dynamic from 'next/dynamic'
23
import Head from 'next/head'
3-
import Link from 'next/link'
44
import Image from 'next/image'
5-
import dynamic from 'next/dynamic'
5+
import Link from 'next/link'
66
import { useRouter } from 'next/router'
77

8-
import { NotionRenderer } from 'react-notion-x'
98
import { ExtendedRecordMap } from 'notion-types'
109
import { getPageTitle } from 'notion-utils'
10+
import { NotionRenderer } from 'react-notion-x'
1111
import TweetEmbed from 'react-tweet-embed'
1212

1313
import { Loading } from './Loading'

examples/full/lib/notion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Client } from '@notionhq/client'
2-
import { NotionCompatAPI } from 'notion-compat'
32
import { NotionAPI } from 'notion-client'
3+
import { NotionCompatAPI } from 'notion-compat'
44
import { ExtendedRecordMap, SearchParams, SearchResults } from 'notion-types'
55

6+
import { previewImagesEnabled, useOfficialNotionAPI } from './config'
67
import { getPreviewImageMap } from './preview-images'
7-
import { useOfficialNotionAPI, previewImagesEnabled } from './config'
88

99
const notion = useOfficialNotionAPI
1010
? new NotionCompatAPI(new Client({ auth: process.env.NOTION_TOKEN }))

examples/full/lib/preview-images.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import got from 'got'
22
import lqip from 'lqip-modern'
3+
import { ExtendedRecordMap, PreviewImage, PreviewImageMap } from 'notion-types'
4+
import { getPageImageUrls } from 'notion-utils'
35
import pMap from 'p-map'
46
import pMemoize from 'p-memoize'
5-
6-
import { ExtendedRecordMap, PreviewImage, PreviewImageMap } from 'notion-types'
77
import { defaultMapImageUrl } from 'react-notion-x'
8-
import { getPageImageUrls } from 'notion-utils'
98

109
// NOTE: this is just an example of how to pre-compute preview images.
1110
// Depending on how many images you're working with, this can potentially be

examples/full/pages/[pageId].tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import * as React from 'react'
22

3+
import { ExtendedRecordMap } from 'notion-types'
34
import { getAllPagesInSpace } from 'notion-utils'
45
import { defaultMapPageUrl } from 'react-notion-x'
5-
import { ExtendedRecordMap } from 'notion-types'
66

77
import * as notion from '../lib/notion'
88
import { NotionPage } from '../components/NotionPage'
99
import {
10-
rootNotionPageId,
11-
rootNotionSpaceId,
12-
rootDomain,
1310
isDev,
14-
previewImagesEnabled
11+
previewImagesEnabled,
12+
rootDomain,
13+
rootNotionPageId,
14+
rootNotionSpaceId
1515
} from '../lib/config'
1616

1717
export const getStaticProps = async (context) => {

examples/full/pages/_app.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import * as React from 'react'
22

3-
import '../styles/globals.css'
4-
5-
// core styles shared by all of react-notion-x (required)
6-
import 'react-notion-x/src/styles.css'
7-
3+
// used for rendering equations (optional)
4+
import 'katex/dist/katex.min.css'
85
// used for code syntax highlighting (optional)
96
import 'prismjs/themes/prism-tomorrow.css'
7+
// core styles shared by all of react-notion-x (required)
8+
import 'react-notion-x/src/styles.css'
109

11-
// used for rendering equations (optional)
12-
import 'katex/dist/katex.min.css'
10+
import '../styles/globals.css'
1311

1412
function MyApp({ Component, pageProps }) {
1513
return <Component {...pageProps} />

0 commit comments

Comments
 (0)