Skip to content

Commit 6cd530c

Browse files
author
Paulo Köch
committed
Add prettier
1 parent 19980e6 commit 6cd530c

36 files changed

+391
-391
lines changed

.eslintrc

+6-155
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@
1515
"jsx": true
1616
}
1717
},
18-
"plugins": [
19-
"react",
20-
"babel"
21-
],
22-
"extends": [
23-
"eslint:recommended",
24-
"plugin:react/recommended"
25-
],
18+
"plugins": ["react", "babel"],
19+
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
2620
"settings": {
2721
"react": {
2822
"version": "16.14"
@@ -55,152 +49,16 @@
5549
],
5650
"no-shadow-restricted-names": "error",
5751
// Stylistic issues
58-
"array-bracket-spacing": "error",
59-
"block-spacing": [
60-
"error",
61-
"always"
62-
],
63-
"comma-dangle": [
64-
"error",
65-
{
66-
"arrays": "always-multiline",
67-
"objects": "always-multiline",
68-
"imports": "always-multiline",
69-
"exports": "always-multiline",
70-
"functions": "always-multiline"
71-
}
72-
],
73-
"comma-spacing": [
74-
"error",
75-
{
76-
"before": false,
77-
"after": true
78-
}
79-
],
80-
"comma-style": [
81-
"error",
82-
"last"
83-
],
84-
"computed-property-spacing": [
85-
"error",
86-
"never"
87-
],
88-
"eol-last": [
89-
"error",
90-
"always"
91-
],
92-
"indent": [
93-
"error",
94-
2,
95-
{
96-
"SwitchCase": 1,
97-
"ignoredNodes": [
98-
"TemplateLiteral"
99-
]
100-
}
101-
],
102-
"jsx-quotes": [
103-
"error",
104-
"prefer-double"
105-
],
106-
"key-spacing": [
107-
"error",
108-
{
109-
"beforeColon": false
110-
}
111-
],
112-
"keyword-spacing": "error",
113-
"max-len": [
114-
"error",
115-
{
116-
"code": 140,
117-
"ignoreTemplateLiterals": true,
118-
"ignoreUrls": true,
119-
"ignoreStrings": true
120-
}
121-
],
122-
"new-parens": "error",
123-
"no-mixed-operators": "error",
124-
"no-multiple-empty-lines": [
125-
"error",
126-
{
127-
"max": 1,
128-
"maxEOF": 0
129-
}
130-
],
13152
"no-nested-ternary": "error",
132-
"no-trailing-spaces": "error",
133-
"no-tabs": "error",
134-
"object-curly-spacing": [
135-
"error",
136-
"always"
137-
],
138-
"prefer-object-spread": "error",
139-
"quotes": [
140-
"error",
141-
"double"
142-
],
143-
"semi": [
144-
"error",
145-
"always",
146-
{
147-
"omitLastInOneLineBlock": true
148-
}
149-
],
150-
"semi-spacing": [
151-
"error",
152-
{
153-
"before": false,
154-
"after": true
155-
}
156-
],
157-
"space-before-blocks": [
158-
"error",
159-
"always"
160-
],
161-
"space-before-function-paren": [
162-
"error",
163-
{
164-
"anonymous": "never",
165-
"named": "never",
166-
"asyncArrow": "always"
167-
}
168-
],
169-
"space-in-parens": "error",
170-
"space-infix-ops": "error",
171-
"space-unary-ops": [
172-
"error",
173-
{
174-
"words": true,
175-
"nonwords": false
176-
}
177-
],
17853
"spaced-comment": [
17954
"error",
18055
"always",
18156
{
182-
"exceptions": [
183-
"-"
184-
]
185-
}
186-
],
187-
"switch-colon-spacing": [
188-
"error",
189-
{
190-
"after": true,
191-
"before": false
57+
"exceptions": ["-"]
19258
}
19359
],
19460
// ECMAScript 6
195-
"arrow-spacing": "error",
196-
"arrow-body-style": [
197-
"error",
198-
"as-needed"
199-
],
200-
"arrow-parens": [
201-
"error",
202-
"always"
203-
],
61+
"arrow-body-style": ["error", "as-needed"],
20462
"no-duplicate-imports": "error",
20563
"no-var": "error",
20664
"prefer-const": [
@@ -218,10 +76,7 @@
21876
},
21977
"overrides": [
22078
{
221-
"files": [
222-
"src/**/*.ts",
223-
"src/**/*.tsx"
224-
],
79+
"files": ["src/**/*.ts", "src/**/*.tsx"],
22580
"excludedFiles": [
22681
"src/components/ui/**/*.ts",
22782
"src/components/ui/**/*.tsx"
@@ -236,11 +91,7 @@
23691
"project": "./tsconfig.json",
23792
"createDefaultProgram": true
23893
},
239-
"plugins": [
240-
"@typescript-eslint",
241-
"react",
242-
"babel"
243-
],
94+
"plugins": ["@typescript-eslint", "react", "babel"],
24495
"extends": [
24596
"eslint:recommended",
24697
"plugin:react/recommended",

.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# From https://www.gatsbyjs.com/plugins/gatsby-plugin-prettier-eslint/
2+
**/node_modules/**/*
3+
**/.git/**/*
4+
**/dist/**/*
5+
.cache/**/*
6+
public/**/*

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

babel.config.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
module.exports = {
2-
"presets": [
3-
["@babel/env", {
4-
"modules": false,
5-
"useBuiltIns": "entry",
6-
"forceAllTransforms": true,
7-
"corejs": "3",
8-
}],
2+
presets: [
3+
[
4+
"@babel/env",
5+
{
6+
modules: false,
7+
useBuiltIns: "entry",
8+
forceAllTransforms: true,
9+
corejs: "3",
10+
},
11+
],
912
"@babel/react",
1013
"@babel/typescript",
1114
],

gatsby-browser.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import React from "react";
33
import Web3Provider from "./src/components/common/Web3Provider";
44

55
export const wrapRootElement = ({ element }: { element: React.ReactNode }) => {
6-
return (<Web3Provider>{element}</Web3Provider>);
7-
}
6+
return <Web3Provider>{element}</Web3Provider>;
7+
};

gatsby-config.ts

+33-26
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,41 @@ const config: GatsbyConfig = {
1111
// If you use VSCode you can also use the GraphQL plugin
1212
// Learn more at: https://gatsby.dev/graphql-typegen
1313
graphqlTypegen: true,
14-
plugins: ["gatsby-plugin-styled-components", "gatsby-plugin-image", "gatsby-plugin-react-helmet", "gatsby-plugin-sharp", "gatsby-transformer-sharp", {
15-
resolve: 'gatsby-source-filesystem',
16-
options: {
17-
"name": "images",
18-
"path": `${__dirname}/src/assets/images/`
14+
plugins: [
15+
"gatsby-plugin-image",
16+
"gatsby-plugin-react-helmet",
17+
"gatsby-plugin-sharp",
18+
"gatsby-plugin-styled-components",
19+
"gatsby-transformer-sharp",
20+
{
21+
resolve: "gatsby-source-filesystem",
22+
options: {
23+
name: "images",
24+
path: `${__dirname}/src/assets/images/`,
25+
},
26+
__key: "images",
1927
},
20-
__key: "images"
21-
},
22-
{
23-
resolve: 'gatsby-plugin-react-svg',
24-
options: {
25-
rule: {
26-
include: /assets/
27-
}
28-
}
29-
},
30-
{
31-
resolve: `gatsby-plugin-manifest`,
32-
options: {
33-
name: `Credentials API demo`,
34-
short_name: `creditentials-api`,
35-
start_url: `/`,
36-
background_color: `#FFFFFF`,
37-
theme_color: `#FFFFFF`,
38-
display: `minimal-ui`,
39-
icon: `src/assets/images/logo.png`, // This path is relative to the root of the site.
28+
{
29+
resolve: "gatsby-plugin-react-svg",
30+
options: {
31+
rule: {
32+
include: /assets/,
33+
},
34+
},
35+
},
36+
{
37+
resolve: `gatsby-plugin-manifest`,
38+
options: {
39+
name: `Credentials API demo`,
40+
short_name: `creditentials-api`,
41+
start_url: `/`,
42+
background_color: `#FFFFFF`,
43+
theme_color: `#FFFFFF`,
44+
display: `minimal-ui`,
45+
icon: `src/assets/images/logo.png`, // This path is relative to the root of the site.
46+
},
4047
},
41-
}]
48+
],
4249
};
4350

4451
export default config;

gatsby-ssr.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import React from "react";
33
import Web3Provider from "./src/components/common/Web3Provider";
44

55
export const wrapRootElement = ({ element }: { element: React.ReactNode }) => {
6-
return (<Web3Provider>{element}</Web3Provider>);
7-
}
6+
return <Web3Provider>{element}</Web3Provider>;
7+
};

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@
5050
"@typescript-eslint/eslint-plugin": "^5.30.5",
5151
"@typescript-eslint/parser": "^5.30.5",
5252
"eslint": "^8.19.0",
53+
"eslint-config-prettier": "^8.5.0",
5354
"eslint-plugin-babel": "^5.3.1",
5455
"eslint-plugin-react": "^7.30.1",
56+
"prettier": "^2.7.1",
5557
"typescript": "^4.7.4"
5658
}
5759
}

src/assets/abi.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
[
2-
{
3-
"inputs": [
4-
{
5-
"internalType": "bytes",
6-
"name": "proof",
7-
"type": "bytes"
8-
},
9-
{
10-
"internalType": "uint256",
11-
"name": "validUntil",
12-
"type": "uint256"
13-
},
14-
{
15-
"internalType": "uint256",
16-
"name": "approvedAt",
17-
"type": "uint256"
18-
},
19-
{
20-
"internalType": "string",
21-
"name": "fractalId",
22-
"type": "string"
23-
}
24-
],
25-
"name": "main",
26-
"outputs": [],
27-
"stateMutability": "nonpayable",
28-
"type": "function"
29-
}
2+
{
3+
"inputs": [
4+
{
5+
"internalType": "bytes",
6+
"name": "proof",
7+
"type": "bytes"
8+
},
9+
{
10+
"internalType": "uint256",
11+
"name": "validUntil",
12+
"type": "uint256"
13+
},
14+
{
15+
"internalType": "uint256",
16+
"name": "approvedAt",
17+
"type": "uint256"
18+
},
19+
{
20+
"internalType": "string",
21+
"name": "fractalId",
22+
"type": "string"
23+
}
24+
],
25+
"name": "main",
26+
"outputs": [],
27+
"stateMutability": "nonpayable",
28+
"type": "function"
29+
}
3030
]

0 commit comments

Comments
 (0)