Skip to content

Commit 2d2428c

Browse files
committed
chore: add prettier plugin to order imports
1 parent b513a42 commit 2d2428c

File tree

114 files changed

+427
-175
lines changed

Some content is hidden

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

114 files changed

+427
-175
lines changed

.prettierrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ module.exports = {
44
singleQuote: true,
55
tabWidth: 2,
66
useTabs: false,
7+
plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')],
8+
importOrder: ['<THIRD_PARTY_MODULES>', '^@socialgouv/(.*)$', '^[./]'],
9+
importOrderSeparation: true,
10+
importOrderSortSpecifiers: true,
711
}

docs/docs/getting-started/04-devtools.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
Create a `Devtools` React component :
66

77
```tsx
8+
import React from 'react'
9+
810
import '@socialgouv/e2esdk-devtools'
911
import { E2ESDKDevtoolsElement } from '@socialgouv/e2esdk-devtools'
1012
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
11-
import React from 'react'
1213

1314
export const Devtools = () => {
1415
const client = useE2ESDKClient()

docs/docs/how-to/01-authentication.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ In React, you can use the `useE2ESDKClientIdentity` hook:
9292

9393
```tsx
9494
import React from 'react'
95+
9596
import { useE2ESDKClientIdentity } from '@socialgouv/e2esdk-react'
9697

9798
export const Profile: React.FC = () => {

docs/docs/how-to/02-keys.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ In React, you can use the `useE2ESDKClientKeys` hook:
118118

119119
```tsx
120120
import React from 'react'
121+
121122
import { useE2ESDKClientKeys } from '@socialgouv/e2esdk-react'
122123

123124
export const Keys: React.FC = () => {

docs/docs/how-to/05-forms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ rewriting the public key to one it controls.
4242

4343
```ts
4444
import {
45-
initializeEncryptedFormLocalState,
4645
encryptFormData,
46+
initializeEncryptedFormLocalState,
4747
} from '@socialgouv/e2esdk-crypto'
4848

4949
async function onSubmit(formValues: Record<string, any>) {
@@ -149,9 +149,9 @@ You can then download the encrypted contents, and use the key in the metadata to
149149

150150
```ts
151151
import {
152-
decryptFileContents,
153152
FileMetadata,
154153
Sodium,
154+
decryptFileContents,
155155
} from '@socialgouv/e2esdk-crypto'
156156

157157
async function downloadAndDecryptFile(sodium: Sodium, metadata: FileMetadata) {
@@ -197,9 +197,9 @@ On the submitter side, edition can be performed by:
197197

198198
```ts
199199
import {
200+
decryptFormForEdition,
200201
initializeEncryptedFormLocalState,
201202
persistEncryptedFormLocalState,
202-
decryptFormForEdition,
203203
} from '@socialgouv/e2esdk-crypto'
204204

205205
const NAMESPACE = 'my-form'

docs/src/components/HomepageFeatures/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import React from 'react'
21
import clsx from 'clsx'
2+
import React from 'react'
3+
34
import styles from './styles.module.css'
45

56
type FeatureItem = {

examples/fullstack/contact-forms/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineConfig } from 'eslint/config'
21
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals'
2+
import { defineConfig } from 'eslint/config'
33
import path from 'node:path'
44
import { fileURLToPath } from 'node:url'
55

examples/fullstack/contact-forms/src/components/EncryptedAvatar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Avatar, AvatarProps } from '@chakra-ui/react'
2-
import type { FileMetadata } from '@socialgouv/e2esdk-crypto'
3-
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
42
import { downloadAndDecryptFile } from 'lib/files'
53
import React from 'react'
64

5+
import type { FileMetadata } from '@socialgouv/e2esdk-crypto'
6+
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
7+
78
export type EncryptedAvatarProps = Omit<AvatarProps, 'src'> & {
89
metadata: FileMetadata
910
}

examples/fullstack/contact-forms/src/components/ShareKeyPopup.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import {
1212
PopoverTrigger,
1313
useDisclosure,
1414
} from '@chakra-ui/react'
15-
import { PublicUserIdentity } from '@socialgouv/e2esdk-client'
16-
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
1715
import { useSubmissionCommentsKey } from 'lib/comments'
1816
import React from 'react'
1917
import FocusLock from 'react-focus-lock'
2018
import { FiShare2, FiShield } from 'react-icons/fi'
19+
20+
import { PublicUserIdentity } from '@socialgouv/e2esdk-client'
21+
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
22+
2123
import { UserIdentityInput } from './UserIdentityInput'
2224

2325
type ShareKeyPopupProps = ButtonProps & {

examples/fullstack/contact-forms/src/components/UserIdentityInput.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import {
1111
InputRightElement,
1212
Spinner,
1313
} from '@chakra-ui/react'
14-
import type { PublicUserIdentity } from '@socialgouv/e2esdk-client'
15-
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
1614
import React from 'react'
1715
import { FiUser } from 'react-icons/fi'
1816

17+
import type { PublicUserIdentity } from '@socialgouv/e2esdk-client'
18+
import { useE2ESDKClient } from '@socialgouv/e2esdk-react'
19+
1920
type UserIdentityInputProps = FormControlProps & {
2021
label?: string
2122
identity: PublicUserIdentity | null

0 commit comments

Comments
 (0)