Skip to content

Commit

Permalink
Configure husky to check for linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
soerface committed Nov 10, 2024
1 parent 14cf833 commit 765645a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run lint
# npm test
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"prepare": "husky",
"test": "echo \"Error: no tests yet specified but husky want's me to have a test command\" && exit 0"
"prepare": "husky"
},
"dependencies": {
"@sentry/integrations": "^7.114.0",
Expand Down
4 changes: 1 addition & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import flipdotLogo from './assets/flipdot.svg'
import './App.css'
// import { Navigate, useLocation, useNavigate } from "react-router-dom";
import Login from "./Login.tsx";
import {AuthProvider, useAuth} from "./AuthContext.tsx";
import React from "react";
import {AuthProvider} from "./AuthContext.tsx";
import {Route, Routes} from "react-router-dom";
import Home from "./Home.tsx";
import RequireAuth from "./RequireAuth.tsx";
Expand Down
3 changes: 1 addition & 2 deletions src/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import flipdotLogo from './assets/flipdot.svg'
import './App.css'

// import { Navigate, useLocation, useNavigate } from "react-router-dom";
import React from "react";


function Home() {
Expand Down
5 changes: 1 addition & 4 deletions src/LoginCallback.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import {useAuth} from "./AuthContext.tsx";
import {useState} from "react";
import {useNavigate} from "react-router-dom";

function LoginCallback() {
const auth = useAuth();
const navigate = useNavigate();
const [error, setError] = useState<string | null>(null);
auth.loginCallback().then(() => {
navigate("/", {replace: true});
}
).catch(
(e) => {
() => {
navigate("/login", {replace: true});
}
);
return <div>
<p>Logging in…</p>
<pre className="error-box">{error}</pre>
</div>;
}

Expand Down

0 comments on commit 765645a

Please sign in to comment.