Formatting entire project
This commit is contained in:
parent
74a5b3930b
commit
a97e9779d1
8 changed files with 30 additions and 27 deletions
|
@ -1,11 +1,15 @@
|
|||
/* eslint-env node */
|
||||
module.exports = {
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', "prettier"],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
],
|
||||
parser: "@typescript-eslint/parser",
|
||||
plugins: ["@typescript-eslint"],
|
||||
root: true,
|
||||
ignorePatterns: ["babel.config.js", "jest.config.js", "node_modules/"],
|
||||
rules: {
|
||||
"@typescript-eslint/explicit-function-return-type": "error"
|
||||
}
|
||||
"@typescript-eslint/explicit-function-return-type": "error",
|
||||
},
|
||||
};
|
4
app.json
4
app.json
|
@ -11,9 +11,7 @@
|
|||
"resizeMode": "contain",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"assetBundlePatterns": [
|
||||
"**/*"
|
||||
],
|
||||
"assetBundlePatterns": ["**/*"],
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = function (api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
presets: ["babel-preset-expo"],
|
||||
};
|
||||
};
|
||||
|
|
|
@ -24,8 +24,8 @@ export function NewPostContainer(): JSX.Element {
|
|||
if (currentInput.length > 0) {
|
||||
const p: NewPost = {
|
||||
content: currentInput,
|
||||
token: "token"
|
||||
}
|
||||
token: "token",
|
||||
};
|
||||
createPost(p);
|
||||
setCurrentInput("");
|
||||
} else {
|
||||
|
|
|
@ -10,10 +10,6 @@ import { style } from "../util/style";
|
|||
* @returns {JSX.Element} The JSX for the Post
|
||||
*/
|
||||
export function PostView({ post }: { post: Post }): JSX.Element {
|
||||
// WARNING THIS IS NOT ACCEPTABLE WARNING REMOVE WARNING
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
// const [thisPost, setThisPost] = React.useState<Post>(post);
|
||||
|
||||
return (
|
||||
<View style={style.postView}>
|
||||
<Text style={style.postFont}>{post.id + " " + post.content}</Text>
|
||||
|
|
|
@ -29,7 +29,7 @@ export function PostsContainer(): JSX.Element {
|
|||
setPage(0);
|
||||
setPostData(await getPostsInterval(0, 10));
|
||||
}
|
||||
setPostData([])
|
||||
setPostData([]);
|
||||
fetchPosts();
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,9 @@ export function PostsContainer(): JSX.Element {
|
|||
<VirtualizedList
|
||||
data={postData}
|
||||
initialNumToRender={4}
|
||||
renderItem={({ item }) => <PostView key={item.id + item.createdAt} post={item} />}
|
||||
renderItem={({ item }) => (
|
||||
<PostView key={item.id + item.createdAt} post={item} />
|
||||
)}
|
||||
keyExtractor={(item: Post) => item.id + item.createdAt}
|
||||
getItemCount={getItemCount}
|
||||
getItem={getItem}
|
||||
|
|
|
@ -56,7 +56,10 @@ export async function getPosts(): Promise<Post[]> {
|
|||
return data;
|
||||
}
|
||||
|
||||
export async function getPostsInterval(offset: number, limit: number): Promise<Post[]> {
|
||||
export async function getPostsInterval(
|
||||
offset: number,
|
||||
limit: number,
|
||||
): Promise<Post[]> {
|
||||
const res = await fetch(URL + `/api/posts?offset=${offset}&limit=${limit}`);
|
||||
const data = await res.json();
|
||||
return data;
|
||||
|
@ -104,7 +107,7 @@ export async function createPost(post: NewPost): Promise<void> {
|
|||
export async function submitRegistration(
|
||||
username: string,
|
||||
password: string,
|
||||
captcha: string
|
||||
captcha: string,
|
||||
): Promise<AuthResponse | undefined> {
|
||||
const response = await fetch(URL + "/api/register", {
|
||||
method: "POST",
|
||||
|
@ -125,7 +128,7 @@ export async function submitRegistration(
|
|||
*/
|
||||
export async function submitLogin(
|
||||
username: string,
|
||||
password: string
|
||||
password: string,
|
||||
): Promise<AuthResponse | undefined> {
|
||||
if (username == "" || password == "") return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue