Skip to content

Commit f32c3bc

Browse files
committed
1 parent 55194d8 commit f32c3bc

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

.eslintrc.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
{
2-
"extends": ["eslint:recommended", "next", "prettier"],
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/eslint-recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"next",
7+
"prettier"
8+
],
39
"env": {
410
"es6": true,
511
"mocha": true
612
},
713
"plugins": ["prettier"],
814
"rules": {
915
"@next/next/no-img-element": "off",
16+
"@typescript-eslint/no-explicit-any": "off",
17+
"@typescript-eslint/no-extra-semi": "off",
18+
"@typescript-eslint/no-var-requires": "off",
1019
"import/no-anonymous-default-export": "off",
1120
"prettier/prettier": "error"
1221
}

back/ProfilePage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const getStaticPathsProfile: GetStaticPaths = async () => {
2828

2929
export function getStaticPropsProfile(tab): GetStaticProps {
3030
return async ({ params: { pid } }) => {
31-
let include = []
31+
const include = []
3232
if (tab === 'my-posts') {
3333
include.push({
3434
model: sequelize.models.User,

front.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function setCookie(name, value, days?: number, path = '/') {
1616
}
1717

1818
export function setCookies(cookieDict, days?: number, path = '/') {
19-
for (let key in cookieDict) {
19+
for (const key in cookieDict) {
2020
setCookie(key, cookieDict[key], days, path)
2121
}
2222
}

front/ArticleEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function editorReducer(state, action) {
4040
}
4141
}
4242

43-
export default function ArticleEditorHoc(isnew: boolean = false) {
43+
export default function ArticleEditorHoc(isnew = false) {
4444
return function ArticleEditor({ article: initialArticle }) {
4545
let initialState
4646
if (initialArticle) {

front/ArticleList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ const ArticleList = ({
2626
const { pid } = query
2727
// The page can be seen up to date from SSR without refetching,
2828
// so we skip the fetch.
29-
let ssrSkipFetch =
29+
const ssrSkipFetch =
3030
page === 0 &&
3131
((loggedInUser && what === 'feed') || (!loggedInUser && what === 'global'))
32-
let fetchURL = (() => {
32+
const fetchURL = (() => {
3333
if (loggedInUser === undefined || (ssr && ssrSkipFetch)) {
3434
// This makes SWR not fetch.
3535
return null

front/useLoggedInUser.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import useSWR from 'swr'
2-
import React from 'react'
32

43
import { AUTH_COOKIE_NAME, AUTH_LOCAL_STORAGE_NAME, getCookie } from 'front'
54
import checkLogin from 'front/checkLogin'
65
import storage from 'front/localStorageHelper'
76

87
export default function useLoggedInUser() {
9-
React.useEffect(() => {})
108
const { data: authCookie } = useSWR('auth/cookie', () => {
119
const ret = getCookie(AUTH_COOKIE_NAME)
1210
if (!ret) {

pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import 'style.scss'
2929

3030
function MyHead() {
3131
const { title } = React.useContext(AppContext)
32-
let realTitle = title === undefined ? '' : title + ' - '
32+
const realTitle = title === undefined ? '' : title + ' - '
3333
return (
3434
<Head>
3535
<meta

0 commit comments

Comments
 (0)