Skip to content

Commit e8dcc5f

Browse files
authored
Using Lint for checking code (#30)
1 parent 97953bc commit e8dcc5f

13 files changed

Lines changed: 23 additions & 18 deletions

my-app/eslint.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export default [
99
files: ['**/*.{js,jsx}'],
1010
languageOptions: {
1111
ecmaVersion: 2020,
12-
globals: globals.browser,
12+
globals: {
13+
...globals.browser,
14+
...globals.node,
15+
},
1316
parserOptions: {
1417
ecmaVersion: 'latest',
1518
ecmaFeatures: { jsx: true },
@@ -30,4 +33,12 @@ export default [
3033
],
3134
},
3235
},
36+
{
37+
files: ['**/tailwind.config.js'], // ✅ Ensure Node.js globals for config files
38+
languageOptions: {
39+
globals: {
40+
...globals.node,
41+
},
42+
},
43+
},
3344
]

my-app/firebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { initializeApp } from "firebase/app";
22
import { getAuth, GoogleAuthProvider, onAuthStateChanged } from "firebase/auth";
3-
import { get, getDatabase, ref, set, serverTimestamp } from "firebase/database";
3+
import { get, getDatabase, ref, set } from "firebase/database";
44

55
// Your web app's Firebase configuration
66
const firebaseConfig = {

my-app/src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { configure, makeAutoObservable, observable } from "mobx";
1+
import { configure, makeAutoObservable } from "mobx";
22
import { createHashRouter, RouterProvider } from "react-router-dom";
33
import { createRoot } from "react-dom/client";
44
import { connectToFirebase } from "../firebase";

my-app/src/presenters/CourseViewPresenter.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import { observer } from "mobx-react-lite";
33
import CourseView from "../views/CourseView.jsx";
44

5-
const CourseViewPresenter = observer(({ model }) => {
6-
return <CourseView />;
5+
const CourseViewPresenter = observer(() => {
6+
return <CourseView/>;
77
});
88

99
export { CourseViewPresenter };

my-app/src/presenters/SidebarPresenter.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { observer } from "mobx-react-lite";
33
import SidebarView from "../views/SidebarView.jsx";
44

5-
const SidebarPresenter = observer(({ model }) => {
5+
const SidebarPresenter = observer(() => {
66
return (
77
<SidebarView/>
88
);

my-app/src/presenters/Tests/AddToDB.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ export const AddToDB = observer(function AddToDB({ model }) {
9696

9797

9898

99-
function onTextChanged(e){
100-
setText(e.target.value);
101-
}
99+
// function onTextChanged(e){
100+
// setText(e.target.value);
101+
// }
102102

103103
// function onSubmit(){
104104
// const course = {courseCode : text, data : "A course"};

my-app/src/views/Components/SideBarComponents/CourseTranscriptList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function CourseTranscriptList() {
55
if (localStorage.getItem("completedCourses"))
66
local = JSON.parse(localStorage.getItem("completedCourses"));
77

8-
8+
// eslint-disable-next-line no-unused-vars
99
window.addEventListener("completedCourses changed", event => {
1010
if (localStorage.getItem("completedCourses"))
1111
local = JSON.parse(localStorage.getItem("completedCourses"));

my-app/src/views/Components/SideBarComponents/SliderField.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { useState } from "react";
33

4-
export default function UploadField(props) {
4+
export default function UploadField() {
55
const values = [1,
66
1.5,
77
2,

my-app/src/views/Components/SideBarComponents/UploadField.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import CourseTranscriptList from './CourseTranscriptList';
33
//import * as scraper from '../../../../src/scripts/transcript-scraper/transcript-scraper.js';
44
import { useState } from "react";
55

6-
export default function UploadField(props) {
7-
8-
96
const [isDragging, setIsDragging] = useState(false);
107

118
const handleDragOver = (event) => {

my-app/src/views/CourseView.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// import React from 'react';
22
// import PrerequisiteTree from "./PrerequisiteTree.jsx";
33
// // import {model} from '/src/model.js';
4-
54
// export default function CourseView({ course }) {
65
// if (!course) return null;
76

0 commit comments

Comments
 (0)