Skip to content

Commit 1be82dc

Browse files
committed
Added Prettier + Standard formatting / linting
1 parent b1e9c19 commit 1be82dc

File tree

16 files changed

+211
-40
lines changed

16 files changed

+211
-40
lines changed

.eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.next
2+
next-env.d.ts
3+
node_modules
4+
yarn.lock
5+
package-lock.json
6+
public

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: ['plugin:react/recommended', 'standard', 'prettier', 'next'],
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
ecmaFeatures: {
10+
jsx: true
11+
},
12+
ecmaVersion: 'latest',
13+
sourceType: 'module'
14+
},
15+
plugins: ['react', '@typescript-eslint'],
16+
rules: {}
17+
}

.eslintrc.json

-3
This file was deleted.

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.next
2+
next-env.d.ts
3+
node_modules
4+
yarn.lock
5+
package-lock.json
6+
public

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true
6+
}

.vscode/settings.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"editor.formatOnPaste": true,
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": true,
7+
"source.fixAll.format": true
8+
},
9+
"[ignore]": {
10+
"editor.defaultFormatter": "foxundermoon.shell-format"
11+
}
12+
}

package.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"start": "next start",
99
"lint": "next lint"
1010
},
11+
"prettier": "prettier-config-standard",
1112
"dependencies": {
1213
"next": "12.1.6",
1314
"react": "18.1.0",
@@ -17,8 +18,19 @@
1718
"@types/node": "17.0.31",
1819
"@types/react": "18.0.9",
1920
"@types/react-dom": "18.0.3",
20-
"eslint": "8.15.0",
21+
"@typescript-eslint/eslint-plugin": "^5.23.0",
22+
"@typescript-eslint/parser": "^5.23.0",
23+
"eslint": "^8.0.1",
2124
"eslint-config-next": "12.1.6",
25+
"eslint-config-prettier": "^8.5.0",
26+
"eslint-config-standard": "^17.0.0",
27+
"eslint-plugin-import": "^2.25.2",
28+
"eslint-plugin-n": "^15.0.0",
29+
"eslint-plugin-promise": "^6.0.0",
30+
"eslint-plugin-react": "^7.29.4",
31+
"prettier": "^2.6.2",
32+
"prettier-config-standard": "^5.0.0",
33+
"tsc": "^2.0.4",
2234
"typescript": "4.6.4"
2335
}
2436
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

pages/api/hello.ts

-13
This file was deleted.

pages/index.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ const Home: NextPage = () => {
3535

3636
<a
3737
href="https://github.com/vercel/next.js/tree/canary/examples"
38-
className={styles.card}
39-
>
38+
className={styles.card}>
4039
<h2>Examples &rarr;</h2>
4140
<p>Discover and deploy boilerplate example Next.js projects.</p>
4241
</a>
4342

4443
<a
4544
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
46-
className={styles.card}
47-
>
45+
className={styles.card}>
4846
<h2>Deploy &rarr;</h2>
4947
<p>
5048
Instantly deploy your Next.js site to a public URL with Vercel.
@@ -57,8 +55,7 @@ const Home: NextPage = () => {
5755
<a
5856
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
5957
target="_blank"
60-
rel="noopener noreferrer"
61-
>
58+
rel="noopener noreferrer">
6259
Powered by{' '}
6360
<span className={styles.logo}>
6461
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />

tsconfig.json

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
53
"allowJs": true,
6-
"skipLibCheck": true,
7-
"strict": true,
8-
"forceConsistentCasingInFileNames": true,
9-
"noEmit": true,
4+
"allowUnreachableCode": false,
5+
"allowUnusedLabels": false,
6+
"declaration": true,
107
"esModuleInterop": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"isolatedModules": true,
10+
"jsx": "preserve",
11+
"lib": ["dom", "dom.iterable", "esnext"],
1112
"module": "esnext",
1213
"moduleResolution": "node",
14+
"noEmit": true,
15+
"noFallthroughCasesInSwitch": true,
16+
"noImplicitReturns": true,
17+
"pretty": true,
1318
"resolveJsonModule": true,
14-
"isolatedModules": true,
15-
"jsx": "preserve",
16-
"incremental": true
19+
"skipLibCheck": true,
20+
"sourceMap": true,
21+
"strict": true,
22+
"target": "es2018"
1723
},
1824
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
1925
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)