Skip to content

Commit f62a226

Browse files
committed
chore(app): add prettier
1 parent c32a7fa commit f62a226

File tree

7 files changed

+62
-32
lines changed

7 files changed

+62
-32
lines changed

app/.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 2,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"useTabs": false
6+
}

app/package-lock.json

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"build": "rm -rf build && NODE_ENV=production node ./esbuild.config.js",
8-
"start": "NODE_ENV=development node ./esbuild.config.js"
8+
"start": "NODE_ENV=development node ./esbuild.config.js",
9+
"format": "prettier --write --use-tabs 'src/**/*.(ts|tsx|js|jsx)'"
910
},
1011
"keywords": [],
1112
"author": "Lakhan Samani",
@@ -19,11 +20,12 @@
1920
"react-dom": "^17.0.2",
2021
"react-is": "^17.0.2",
2122
"react-router-dom": "^5.2.0",
22-
"typescript": "^4.3.5",
23-
"styled-components": "^5.3.0"
23+
"styled-components": "^5.3.0",
24+
"typescript": "^4.3.5"
2425
},
2526
"devDependencies": {
2627
"@types/react-router-dom": "^5.1.8",
27-
"@types/styled-components": "^5.1.11"
28+
"@types/styled-components": "^5.1.11",
29+
"prettier": "2.7.1"
2830
}
2931
}

app/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import Root from './Root';
55
import { createRandomString } from './utils/common';
66

77
declare global {
8-
interface Window {
9-
__authorizer__: any;
10-
}
8+
interface Window {
9+
__authorizer__: any;
10+
}
1111
}
1212

1313
export default function App() {

app/src/Root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function Root({
3232
const { token, loading, config } = useAuthorizer();
3333

3434
const searchParams = new URLSearchParams(
35-
hasWindow() ? window.location.search : ``
35+
hasWindow() ? window.location.search : ``,
3636
);
3737
const state = searchParams.get('state') || createRandomString();
3838
const scope = searchParams.get('scope')

app/src/theme.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
// colors: https://tailwindcss.com/docs/customizing-colors
22

33
export const theme = {
4-
colors: {
5-
primary: '#3B82F6',
6-
primaryDisabled: '#60A5FA',
7-
gray: '#D1D5DB',
8-
danger: '#DC2626',
9-
success: '#10B981',
10-
textColor: '#374151',
11-
},
12-
fonts: {
13-
// typography
14-
fontStack: '-apple-system, system-ui, sans-serif',
4+
colors: {
5+
primary: '#3B82F6',
6+
primaryDisabled: '#60A5FA',
7+
gray: '#D1D5DB',
8+
danger: '#DC2626',
9+
success: '#10B981',
10+
textColor: '#374151',
11+
},
12+
fonts: {
13+
// typography
14+
fontStack: '-apple-system, system-ui, sans-serif',
1515

16-
// font sizes
17-
largeText: '18px',
18-
mediumText: '14px',
19-
smallText: '12px',
20-
tinyText: '10px',
21-
},
16+
// font sizes
17+
largeText: '18px',
18+
mediumText: '14px',
19+
smallText: '12px',
20+
tinyText: '10px',
21+
},
2222

23-
radius: {
24-
card: '5px',
25-
button: '5px',
26-
input: '5px',
27-
},
23+
radius: {
24+
card: '5px',
25+
button: '5px',
26+
input: '5px',
27+
},
2828
};

app/src/utils/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const createRandomString = () => {
88
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.';
99
let random = '';
1010
const randomValues = Array.from(
11-
getCrypto().getRandomValues(new Uint8Array(43))
11+
getCrypto().getRandomValues(new Uint8Array(43)),
1212
);
1313
randomValues.forEach((v) => (random += charset[v % charset.length]));
1414
return random;

0 commit comments

Comments
 (0)