Skip to content

Commit

Permalink
linting testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andychenbruce committed Mar 11, 2024
1 parent 2b5eae5 commit d60423a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/npm.yml → .github/workflows/react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:
- uses: actions/checkout@v3
- name: Install
working-directory: ./frontend
run: npm install
run: yarn install
- name: Lint
working-directory: ./frontend
run: yarn eslint src
# - name: Format
# working-directory: ./frontend
# run: npx prettier --check ./
# run: yarn prettier --check ./
- name: Build
working-directory: ./frontend
run: npm run build
run: yarn run build
2 changes: 1 addition & 1 deletion frontend/src/backend_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface EditCard {
access_token: AccessToken;
deck_id: number;
card_index: number;
new_question: String;
new_question: string;
new_answer: string;
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/acc_create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Main: React.FC<PageProps> = () => {
setPasswordMismatch(true);
return;
}
let new_user_request: NewUser = {
const new_user_request: NewUser = {
user_name: user.username,
email: user.email,
password: user.password1,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/ai_test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const App: React.FC = () => {
prompt: prompt,
};
send_json_backend(ENDPOINT_AI_TEST, JSON.stringify(aiSend))
.then((data: any) => {
.then((data: string) => {
const responseData = JSON.parse(data);
setResponse(responseData.content);
})
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/pages/deck_manage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,22 @@ const App: React.FC = () => {

const handleIconSelectionConfirm = () => {

let temp_deck_id = currentEditing
const temp_deck_id = currentEditing
if (temp_deck_id == null){
console.error('deck_id is null')
return;
}
let access_token = get_session_token();
const access_token = get_session_token();
if (access_token == null) {
return;
}
let index = selectedIcon
const index = selectedIcon
if (index === null) {
console.error('No icon selected');
changeIconErrorSnackbar(true)
return;
}
let new_icon: SetDeckIcon = {
const new_icon: SetDeckIcon = {
access_token: access_token,
deck_id: temp_deck_id,
icon: index,
Expand All @@ -206,7 +206,7 @@ const App: React.FC = () => {
setSelectedIcon(index);
};

const handleEditDeckIcon = (_deckId: number) => {
const handleEditDeckIcon = () => {
setOpenIconDialog(true);
};

Expand Down Expand Up @@ -485,7 +485,7 @@ const App: React.FC = () => {

<IconButton
onClick={() => {
handleEditDeckIcon(deck.deck_id);
handleEditDeckIcon();
setCurrentEditing(deck.deck_id);
}}

Expand Down

0 comments on commit d60423a

Please sign in to comment.