Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Prettier and fix ESLint complaints (#28)
* Apply ESLint & Prettier on `src/` * Fix more ESLint complaints * No error on unmatched pattern * Fix null assertion warnings * Remove ts-ignore directive Co-authored-by: George Watkins <gwwatkin@sfu.ca>
- Loading branch information
1 parent
9226d0e
commit 3335f3b
Showing
14 changed files
with
710 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import React from "react" | ||
import { render, screen } from "@testing-library/react" | ||
import App from "./App" | ||
|
||
// TODO this needs to be populated with real tests | ||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); | ||
test("renders learn react link", () => { | ||
render(<App />) | ||
const linkElement = screen.getByText(/learn react/i) | ||
expect(linkElement).toBeInTheDocument() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import React from 'react'; | ||
import React from "react" | ||
|
||
import BaseTemplate from "./pages/BaseTemplate"; | ||
import BaseTemplate from "./pages/BaseTemplate" | ||
|
||
const App = () => <BaseTemplate /> | ||
|
||
const App = () => <BaseTemplate />; | ||
|
||
export default App; | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,57 @@ | ||
import {Slices} from "./slices"; | ||
import { Slices } from "./slices" | ||
|
||
// Different classes representing possible Api Response outcomes | ||
class JsonParseError { | ||
msg: string | ||
constructor(msg : string) { | ||
this.msg = msg | ||
} | ||
msg: string | ||
constructor(msg: string) { | ||
this.msg = msg | ||
} | ||
} | ||
|
||
class ApiHttpError { | ||
code: number | ||
msg: string | ||
headers: string | ||
constructor(code: number, msg : string, headers: string) { | ||
this.code = code | ||
this.msg = msg | ||
this.headers = headers | ||
} | ||
code: number | ||
msg: string | ||
headers: string | ||
constructor(code: number, msg: string, headers: string) { | ||
this.code = code | ||
this.msg = msg | ||
this.headers = headers | ||
} | ||
} | ||
|
||
class CompilerError { | ||
msg: string | ||
errortype: string | ||
constructor(msg: string, errortype: string){ | ||
this.msg = msg | ||
this.errortype = errortype; | ||
} | ||
msg: string | ||
errortype: string | ||
constructor(msg: string, errortype: string) { | ||
this.msg = msg | ||
this.errortype = errortype | ||
} | ||
} | ||
|
||
class CompilationResultSuccess { | ||
slices: Slices | ||
compilation_text: string | ||
constructor(slices : Slices, compilation_text : string) { | ||
this.slices = slices | ||
this.compilation_text = compilation_text | ||
} | ||
slices: Slices | ||
compilation_text: string | ||
constructor(slices: Slices, compilation_text: string) { | ||
this.slices = slices | ||
this.compilation_text = compilation_text | ||
} | ||
} | ||
|
||
class NoServerResponse { | ||
response: string | ||
constructor(response: string) { | ||
this.response = response | ||
} | ||
response: string | ||
constructor(response: string) { | ||
this.response = response | ||
} | ||
} | ||
|
||
type ApiResponse = null | JsonParseError | ApiHttpError | CompilationResultSuccess | CompilerError | NoServerResponse; | ||
type ApiResponse = | ||
| null | ||
| JsonParseError | ||
| ApiHttpError | ||
| CompilationResultSuccess | ||
| CompilerError | ||
| NoServerResponse | ||
|
||
export type {ApiResponse} | ||
export type { ApiResponse } | ||
|
||
export {JsonParseError,ApiHttpError,CompilationResultSuccess,NoServerResponse,CompilerError} | ||
export { JsonParseError, ApiHttpError, CompilationResultSuccess, NoServerResponse, CompilerError } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import React from "react"; | ||
import {ApiResponse} from "./apiResponses"; | ||
import React from "react" | ||
import { ApiResponse } from "./apiResponses" | ||
|
||
class AppState { | ||
compilationIsLoading : boolean = false | ||
compilationIsLoading: boolean = false | ||
apiResponse: ApiResponse = null | ||
} | ||
|
||
interface AppStateProps { | ||
appState : AppState; | ||
setAppState : React.Dispatch<AppState> | ||
appState: AppState | ||
setAppState: React.Dispatch<AppState> | ||
} | ||
|
||
export { AppState } | ||
export type { AppStateProps } | ||
|
Oops, something went wrong.