Skip to content

Commit 7863b60

Browse files
huv1ktimneutkens
authored andcommitted
Prettier fix (vercel#8754)
1 parent a0341ea commit 7863b60

File tree

31 files changed

+148
-248
lines changed

31 files changed

+148
-248
lines changed

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: PR Stats
66
runs-on: ubuntu-latest
77
steps:
8-
- name: PR Stats
9-
uses: zeit/next-stats-action@master
10-
env:
11-
COMMENT_ENDPOINT: https://next-stats.jjsweb.site/api/comment
8+
- name: PR Stats
9+
uses: zeit/next-stats-action@master
10+
env:
11+
COMMENT_ENDPOINT: https://next-stats.jjsweb.site/api/comment

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: PR Stats
66
runs-on: ubuntu-latest
77
steps:
8-
- name: PR Stats
9-
uses: zeit/next-stats-action@master
10-
env:
11-
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
8+
- name: PR Stats
9+
uses: zeit/next-stats-action@master
10+
env:
11+
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}

errors/app-container-deprecated.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This handling has been moved up the tree so the `<Container>` component is no lo
1010
Remove the `<Container>` component from your Custom `<App>` (`./pages/_app.js`).
1111

1212
**Before**
13+
1314
```jsx
1415
import React from 'react'
1516
import App, { Container } from 'next/app'
@@ -29,6 +30,7 @@ export default MyApp
2930
```
3031

3132
**After**
33+
3234
```jsx
3335
import React from 'react'
3436
import App from 'next/app'

errors/incompatible-href-as.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ Somewhere you are utilizing the `next/link` component, `Router#push`, or `Router
77
Note: this error will only show when the `next/link` component is clicked not when only rendered.
88

99
**Incompatible `href` and `as`**
10+
1011
```jsx
1112
import Link from 'next/link'
1213

1314
export default () => (
1415
<>
15-
<Link href='/[post]' as='/post-1/comments'>
16+
<Link href="/[post]" as="/post-1/comments">
1617
<a>Invalid link</a>
1718
</Link>
1819
</>
1920
)
2021
```
2122

2223
**Compatible `href` and `as`**
24+
2325
```jsx
2426
import Link from 'next/link'
2527

2628
export default () => (
2729
<>
28-
<Link href='/[post]' as='/post-1'>
30+
<Link href="/[post]" as="/post-1">
2931
<a>Valid link</a>
3032
</Link>
3133
</>

errors/invalid-href-passed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#### Why This Error Occurred
44

5-
Next.js provides a router which can be utilized via a component imported via `next/link`, a wrapper `withRouter(Component)`, and now a hook `useRouter()`.
5+
Next.js provides a router which can be utilized via a component imported via `next/link`, a wrapper `withRouter(Component)`, and now a hook `useRouter()`.
66
When using any of these, it is expected they are only used for internal navigation, i.e. navigating between pages in the same Next.js application.
77

88
Either you passed a non-internal `href` to a `next/link` component or you called `Router#push` or `Router#replace` with one.

errors/minification-disabled.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ This severely degrades your application's performance at runtime. It can also re
1212
Be sure your `next.config.js` has not modified `optimization.minimize` or `optimization.minimizer`.
1313

1414
You can file an issue on our GitHub if you do not understand why minification is being disabled by your `next.config.js`.
15-

examples/custom-server-typescript/tsconfig.json

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
"target": "esnext",
44
"module": "esnext",
55
"jsx": "preserve",
6-
"lib": [
7-
"dom",
8-
"es2017"
9-
],
6+
"lib": ["dom", "es2017"],
107
"baseUrl": ".",
118
"moduleResolution": "node",
129
"strict": true,
@@ -24,15 +21,6 @@
2421
"forceConsistentCasingInFileNames": true,
2522
"resolveJsonModule": true
2623
},
27-
"exclude": [
28-
"dist",
29-
".next",
30-
"out",
31-
"next.config.js"
32-
],
33-
"include": [
34-
"next-env.d.ts",
35-
"**/*.ts",
36-
"**/*.tsx"
37-
]
24+
"exclude": ["dist", ".next", "out", "next.config.js"],
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
3826
}

examples/with-aws-amplify-typescript/README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ cd with-aws-amplify-typescript
3030

3131
#### Install & Configure Amplify
3232

33-
1. [Sign up](https://portal.aws.amazon.com/billing/signup#/start) for an AWS account
34-
2. Install the AWS Amplify cli:
35-
```sh
33+
1. [Sign up](https://portal.aws.amazon.com/billing/signup#/start) for an AWS account
34+
2. Install the AWS Amplify cli:
35+
36+
```sh
3637
npm install -g @aws-amplify/cli
37-
```
38-
3. Configure the Amplify cli
39-
```sh
38+
```
39+
40+
3. Configure the Amplify cli
41+
42+
```sh
4043
amplify configure
41-
```
42-
[Read More](https://aws-amplify.github.io/docs/cli-toolchain/quickstart?sdk=js)
44+
```
45+
46+
[Read More](https://aws-amplify.github.io/docs/cli-toolchain/quickstart?sdk=js)
47+
4348
</details>
4449

4550
#### Initialize Amplify
@@ -52,9 +57,9 @@ $ amplify init
5257
? Enter a name for the environment: dev (or whatever you would like to call this env)
5358
? Choose your default editor: <YOUR_EDITOR_OF_CHOICE>
5459
? Choose the type of app that you're building (Use arrow keys)
55-
android
56-
ios
57-
❯ javascript
60+
android
61+
ios
62+
❯ javascript
5863
? What javascript framework are you using react
5964
? Source Directory Path: src
6065
? Distribution Directory Path: out
@@ -71,11 +76,11 @@ $ amplify init
7176
$ amplify add api
7277
# <Interactive>
7378
? Please select from one of the below mentioned services (Use arrow keys)
74-
❯ GraphQL
75-
REST
79+
❯ GraphQL
80+
REST
7681
? Provide API name: <API_NAME>
7782
? Choose an authorization type for the API (Use arrow keys)
78-
❯ API key
83+
❯ API key
7984
Amazon Cognito User Pool
8085
? Do you have an annotated GraphQL schema? (y/N) y
8186
? Provide your schema file path: ./schema.graphql
@@ -90,12 +95,12 @@ $ amplify push
9095
? Are you sure you want to continue? Y
9196
? Do you want to generate code for your newly created GraphQL API? Y
9297
? Choose the code generation language target (Use arrow keys)
93-
javascript
94-
❯ typescript
98+
javascript
99+
❯ typescript
95100
flow
96-
? Enter the file name pattern of graphql queries, mutations and subscriptions (src/graphql/**/*.js)
101+
? Enter the file name pattern of graphql queries, mutations and subscriptions (src/graphql/**/*.js)
97102
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions (Y/n) Y
98-
? Enter maximum statement depth [increase from default if your schema is deeply nested] (2)
103+
? Enter maximum statement depth [increase from default if your schema is deeply nested] (2)
99104
100105
# </Interactive>
101106
```
@@ -114,7 +119,7 @@ yarn dev
114119
115120
1. Open [`amplify/backend/api/nextjswithamplifyts/schema.graphql`](amplify/backend/api/nextjswithamplifyts/schema.graphql) and change what you need to.
116121
2. Run `amplify push`
117-
3. 👍
122+
3. 👍
118123
119124
## The idea behind the example
120125
@@ -124,10 +129,8 @@ We use AWS Amplify to generate code and to manage and consume the AWS cloud reso
124129
125130
The NextJS app has dynamic and static routes to demonstrate how to load data on the server based on the incoming request.
126131
127-
Two routes are implemented :
132+
Two routes are implemented :
128133
129134
- `/` : A static route that uses getInitialProps to load data from AppSync and renders it on the server (Code in [pages/index.tsx](/pages/index.tsx))
130135
131136
- `/todo/[id]` : A dynamic route that uses getInitialProps and the id from the provided context to load a single todo from AppSync and render it on the server. (Code in [pages/todo/:[id].tsx](/pages/todo/[id].tsx))
132-
133-
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"strict": false,
@@ -18,12 +14,6 @@
1814
"isolatedModules": true,
1915
"jsx": "preserve"
2016
},
21-
"exclude": [
22-
"node_modules"
23-
],
24-
"include": [
25-
"next-env.d.ts",
26-
"**/*.ts",
27-
"**/*.tsx"
28-
]
17+
"exclude": ["node_modules"],
18+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
2919
}

examples/with-aws-amplify/README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ cd with-aws-amplify
3030

3131
#### Install & Configure Amplify
3232

33-
1. [Sign up](https://portal.aws.amazon.com/billing/signup#/start) for an AWS account
34-
2. Install the AWS Amplify cli:
35-
```sh
33+
1. [Sign up](https://portal.aws.amazon.com/billing/signup#/start) for an AWS account
34+
2. Install the AWS Amplify cli:
35+
36+
```sh
3637
npm install -g @aws-amplify/cli
37-
```
38-
3. Configure the Amplify cli
39-
```sh
38+
```
39+
40+
3. Configure the Amplify cli
41+
42+
```sh
4043
amplify configure
41-
```
42-
[Read More](https://aws-amplify.github.io/docs/cli-toolchain/quickstart?sdk=js)
44+
```
45+
46+
[Read More](https://aws-amplify.github.io/docs/cli-toolchain/quickstart?sdk=js)
47+
4348
</details>
4449

4550
#### Initialize Amplify
@@ -52,9 +57,9 @@ $ amplify init
5257
? Enter a name for the environment: dev (or whatever you would like to call this env)
5358
? Choose your default editor: <YOUR_EDITOR_OF_CHOICE>
5459
? Choose the type of app that you're building (Use arrow keys)
55-
android
56-
ios
57-
❯ javascript
60+
android
61+
ios
62+
❯ javascript
5863
? What javascript framework are you using react
5964
? Source Directory Path: src
6065
? Distribution Directory Path: out
@@ -71,11 +76,11 @@ $ amplify init
7176
$ amplify add api
7277
# <Interactive>
7378
? Please select from one of the below mentioned services (Use arrow keys)
74-
❯ GraphQL
75-
REST
79+
❯ GraphQL
80+
REST
7681
? Provide API name: <API_NAME>
7782
? Choose an authorization type for the API (Use arrow keys)
78-
❯ API key
83+
❯ API key
7984
Amazon Cognito User Pool
8085
? Do you have an annotated GraphQL schema? (y/N) y
8186
? Provide your schema file path: ./schema.graphql
@@ -90,12 +95,12 @@ $ amplify push
9095
? Are you sure you want to continue? Y
9196
? Do you want to generate code for your newly created GraphQL API? Y
9297
? Choose the code generation language target (Use arrow keys)
93-
❯ javascript
94-
typescript
98+
❯ javascript
99+
typescript
95100
flow
96-
? Enter the file name pattern of graphql queries, mutations and subscriptions (src/graphql/**/*.js)
101+
? Enter the file name pattern of graphql queries, mutations and subscriptions (src/graphql/**/*.js)
97102
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions (Y/n) Y
98-
? Enter maximum statement depth [increase from default if your schema is deeply nested] (2)
103+
? Enter maximum statement depth [increase from default if your schema is deeply nested] (2)
99104
100105
# </Interactive>
101106
```
@@ -114,7 +119,7 @@ yarn dev
114119
115120
1. Open `amplify/backend/api/projectname/schema.graphql` and change what you need to.
116121
2. Run `amplify push`
117-
3. 👍
122+
3. 👍
118123
119124
### Use with new Amplify project
120125
@@ -123,8 +128,8 @@ Make sure to commit your changes before doing this.
123128
```sh
124129
mv amplify/backend/api/nextjswithawsamplify/schema.graphql ./schema.graphql
125130
rm -rf amplify/ src/
126-
amplify init
127-
amplify add api
131+
amplify init
132+
amplify add api
128133
rm ./schema.graphql
129134
amplify push
130135
```
@@ -137,10 +142,8 @@ We use AWS Amplify to generate code and to manage and consume the AWS cloud reso
137142
138143
The NextJS app has dynamic and static routes to demonstrate how to load data on the server based on the incoming request.
139144
140-
Two routes are implemented :
145+
Two routes are implemented :
141146
142147
- `/` : A static route that uses getInitialProps to load data from AppSync and renders it on the server (Code in [pages/index.js](/pages/index.js))
143148
144149
- `/todo/[id]` : A dynamic route that uses getInitialProps and the id from the provided context to load a single todo from AppSync and render it on the server. (Code in [pages/todo/:[id].js](/pages/todo/[id].js))
145-
146-

examples/with-electron-typescript/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ cd with-electron-typescript
2424
```
2525

2626
To install and start dev build:
27+
2728
```bash
2829
yarn install && yarn build && yarn start
2930
```
@@ -43,17 +44,18 @@ Available commands:
4344

4445
This example show how you can use Next.js inside an Electron application to avoid a lot of configuration, use Next.js router as view and use server-render to speed up the initial render of the application. Both Next.js and Electron layers are written in TypeScript and compiled to JavaScript during the build process.
4546

46-
| Part| Source code (Typescript) | Builds (JavaScript) |
47-
| -- | -- | -- |
48-
| Next.js | `/renderer` | `/renderer` |
49-
| Electron | `/electron-src` | `/main` |
50-
| Production | | `/dist` |
47+
| Part | Source code (Typescript) | Builds (JavaScript) |
48+
| ---------- | ------------------------ | ------------------- |
49+
| Next.js | `/renderer` | `/renderer` |
50+
| Electron | `/electron-src` | `/main` |
51+
| Production | | `/dist` |
5152

5253
For development it's going to run a HTTP server and let Next.js handle routing. In production it use `next export` to pre-generate HTML static files and use them in your app instead of running an HTTP server.
5354

5455
You can create the production app using `npm run dist`.
5556

5657
_note regarding types:_
57-
* Electron provides its own type definitions, so you don't need @types/electron installed!
58-
source: https://www.npmjs.com/package/@types/electron
59-
* There were no types available for `electron-next` at the time of creating this example, so until they are available there is a file `electron-next.d.ts` in `electron-src` directory.
58+
59+
- Electron provides its own type definitions, so you don't need @types/electron installed!
60+
source: https://www.npmjs.com/package/@types/electron
61+
- There were no types available for `electron-next` at the time of creating this example, so until they are available there is a file `electron-next.d.ts` in `electron-src` directory.

0 commit comments

Comments
 (0)