Skip to content

Commit a591f06

Browse files
committed
lint
1 parent a5c0a37 commit a591f06

File tree

8 files changed

+51
-42
lines changed

8 files changed

+51
-42
lines changed

ui/.eslintrc.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"browser": true,
44
"es2021": true
55
},
6-
"extends": [
7-
"eslint:recommended",
8-
"plugin:react/recommended",
9-
"plugin:prettier/recommended"
10-
],
6+
"settings": {
7+
"react": {
8+
"version": "detect"
9+
}
10+
},
11+
"extends": ["eslint:recommended", "plugin:react/recommended"],
1112
"parserOptions": {
1213
"ecmaFeatures": {
1314
"jsx": true
@@ -17,10 +18,10 @@
1718
},
1819
"plugins": ["react"],
1920
"rules": {
20-
"indent": ["error", 4],
2121
"linebreak-style": ["error", "unix"],
2222
"quotes": ["error", "single"],
2323
"semi": ["error", "never"],
24-
"comma-dange": ["error", "always"]
24+
"comma-spacing": "error",
25+
"comma-dangle": ["error", "always"]
2526
}
2627
}

ui/.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "authentication with react and go",
55
"private": true,
66
"dependencies": {
7+
"eslint-plugin-prettier": "^4.0.0",
78
"react": "^16.8.6",
89
"react-dom": "^16.8.6",
910
"react-router-dom": "^5.0.1",
@@ -38,7 +39,6 @@
3839
"eslint-plugin-import": "^2.24.2",
3940
"eslint-plugin-node": "^11.1.0",
4041
"eslint-plugin-promise": "^5.1.0",
41-
"eslint-plugin-react": "^7.26.1",
42-
"prettier": "^2.4.1"
42+
"eslint-plugin-react": "^7.26.1"
4343
}
4444
}

ui/src/App.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React from 'react'
2-
import { BrowserRouter as Router, Route } from 'react-router-dom'
2+
import { BrowserRouter as Router, Route, } from 'react-router-dom'
33
import Register from './pages/Register'
44
import Login from './pages/Login'
55
import Session from './pages/Session'
66
import './App.css'
77

88
function App() {
9-
return (
10-
<Router>
11-
<Route exact path="/" component={Session} />
12-
<Route path="/register" component={Register} />
13-
<Route path="/login" component={Login} />
14-
<Route path="/session" component={Session} />
15-
</Router>
16-
)
9+
return (
10+
<Router>
11+
<Route exact path="/" component={Session} />
12+
<Route path="/register" component={Register} />
13+
<Route path="/login" component={Login} />
14+
<Route path="/session" component={Session} />
15+
</Router>
16+
)
1717
}
1818

1919
export default App

ui/src/api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export const apiURl = 'http://localhost:8081'
22

33
export const Endpoints = {
4-
login: `${apiURl}/api/login`,
5-
register: `${apiURl}/api/register`,
6-
session: `${apiURl}/api/session`,
7-
logout: `${apiURl}/api/logout`,
4+
login: `${apiURl}/api/login`,
5+
register: `${apiURl}/api/register`,
6+
session: `${apiURl}/api/session`,
7+
logout: `${apiURl}/api/logout`,
88
}

ui/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "react"
2-
import ReactDOM from "react-dom"
3-
import App from "./App"
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import App from './App'
44

5-
ReactDOM.render(<App />, document.getElementById("root"))
5+
ReactDOM.render(<App />, document.getElementById('root',),)

ui/src/utils.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export const createCookie = (cookieName, cookieValue, hourToExpire) => {
2-
const date = new Date()
3-
date.setTime(date.getTime() + hourToExpire * 60 * 60 * 1000)
4-
document.cookie = `${cookieName} = ${cookieValue}; expires = ${date.toGMTString()}`
1+
export const createCookie = (cookieName, cookieValue, hourToExpire,) => {
2+
const date = new Date()
3+
date.setTime(date.getTime() + hourToExpire * 60 * 60 * 1000,)
4+
document.cookie = `${cookieName} = ${cookieValue}; expires = ${date.toGMTString()}`
55
}
66

7-
export const deleteCookie = (name) =>
8-
(document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;')
7+
export const deleteCookie = (name,) =>
8+
(document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;')

ui/yarn.lock

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,13 @@ eslint-plugin-node@^11.1.0:
29382938
resolve "^1.10.1"
29392939
semver "^6.1.0"
29402940

2941+
eslint-plugin-prettier@^4.0.0:
2942+
version "4.0.0"
2943+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0"
2944+
integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==
2945+
dependencies:
2946+
prettier-linter-helpers "^1.0.0"
2947+
29412948
eslint-plugin-promise@^5.1.0:
29422949
version "5.1.0"
29432950
resolved "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz"
@@ -3364,6 +3371,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
33643371
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
33653372
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
33663373

3374+
fast-diff@^1.1.2:
3375+
version "1.2.0"
3376+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
3377+
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
3378+
33673379
fast-json-stable-stringify@^2.0.0:
33683380
version "2.0.0"
33693381
resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz"
@@ -6747,10 +6759,12 @@ preserve@^0.2.0:
67476759
resolved "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz"
67486760
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=
67496761

6750-
prettier@^2.4.1:
6751-
version "2.4.1"
6752-
resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz"
6753-
integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==
6762+
prettier-linter-helpers@^1.0.0:
6763+
version "1.0.0"
6764+
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
6765+
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
6766+
dependencies:
6767+
fast-diff "^1.1.2"
67546768

67556769
pretty-bytes@^4.0.2:
67566770
version "4.0.2"

0 commit comments

Comments
 (0)