-
Notifications
You must be signed in to change notification settings - Fork 516
Add TypeScript, catch bugs #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
9 changes: 7 additions & 2 deletions
9
gdbgui/src/js/CopyToClipboard.jsx → gdbgui/src/js/CopyToClipboard.tsx
This file contains hidden or 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 hidden or 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 hidden or 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,14 +1,22 @@ | ||
import Actions from "./Actions.js"; | ||
import React from "react"; | ||
import CopyToClipboard from "./CopyToClipboard.jsx"; | ||
import * as React from "react"; | ||
import CopyToClipboard from "./CopyToClipboard"; | ||
import MemoryLink from "./MemoryLink"; | ||
|
||
class FileLink extends React.Component { | ||
type Props = { | ||
file?: string | ||
fullname?: string | ||
line: string | ||
num_lines?: number | ||
}; | ||
|
||
export class FileLink extends React.Component<Props> { | ||
render() { | ||
let line = parseInt(this.props.line); | ||
let onclick = null, | ||
let onclick = () => {}, | ||
cls = ""; | ||
if (!this.props.file || !line) { | ||
line = ""; | ||
line = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug #3: |
||
} | ||
let sep = ""; | ||
if (line && line !== 0) { | ||
|
@@ -43,7 +51,14 @@ class FileLink extends React.Component { | |
} | ||
} | ||
|
||
class FrameLink extends React.Component { | ||
type FrameLinkProps = { | ||
addr: string | ||
file?: string | ||
fullname?: string | ||
line: string | ||
}; | ||
|
||
export class FrameLink extends React.Component<FrameLinkProps> { | ||
render() { | ||
return ( | ||
<div> | ||
|
@@ -58,6 +73,3 @@ class FrameLink extends React.Component { | |
); | ||
} | ||
} | ||
|
||
export { FileLink }; | ||
export { FrameLink }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module 'statorgfc' { | ||
export let store: { | ||
get(key: string): any | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,4 +1,8 @@ | ||
module.exports = { | ||
"preset": 'ts-jest', | ||
"verbose": true, | ||
"testMatch": [__dirname + '/gdbgui/src/js/tests/**'] | ||
"testMatch": [__dirname + '/gdbgui/src/js/tests/**'], | ||
"transform": { | ||
'^.+\.(j|t)sx?$': 'ts-jest' | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"downlevelIteration": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"jsx": "react", | ||
"lib": ["dom", "es2015", "es2016.array.include"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"newLine": "LF", | ||
"noEmitOnError": false, | ||
"outDir": "dist", | ||
"preserveConstEnums": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "es5" | ||
}, | ||
"include": [ | ||
"./gdbgui/src/js" | ||
] | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jquery": true | ||
}, | ||
"extends": ["tslint-config-prettier"], | ||
"globals": { | ||
"initial_data": true, | ||
"module": true, | ||
"_": true, | ||
"moment": true | ||
}, | ||
"jsRules": { | ||
"indent": { | ||
"options": ["spaces"] | ||
} | ||
}, | ||
"rules": { | ||
"quotemark": true, | ||
"semicolon": true | ||
} | ||
} |
This file contains hidden or 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,31 +1,42 @@ | ||
const path = require('path'); | ||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
|
||
module.exports = { | ||
entry: './gdbgui/src/js/gdbgui.jsx', | ||
devtool: 'source-map', | ||
cs01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
performance: { | ||
hints: false | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, 'gdbgui/static/js/'), | ||
filename: 'build.js' | ||
}, | ||
module: { | ||
rules: [ | ||
{ test: /\.js$/, | ||
use: [ | ||
'babel-loader', | ||
'eslint-loader', | ||
], | ||
exclude: /node_modules/ | ||
}, | ||
{ test: /\.jsx$/, | ||
use: [ | ||
'babel-loader', | ||
'eslint-loader', | ||
], | ||
exclude: /node_modules/ | ||
} | ||
] | ||
rules: [{ | ||
test: /\.(j|t)sx?$/, | ||
use: [ | ||
{ | ||
loader: 'ts-loader', | ||
options: { | ||
experimentalFileCaching: true, | ||
experimentalWatchApi: true, | ||
transpileOnly: true | ||
} | ||
}, | ||
{ | ||
loader: 'tslint-loader', | ||
options: { | ||
fix: true, | ||
typeCheck: true | ||
} | ||
} | ||
], | ||
exclude: /node_modules/ | ||
}] | ||
}, | ||
plugins: [ | ||
new ForkTsCheckerWebpackPlugin({ | ||
tslint: true, | ||
tslintAutoFix: true | ||
}) | ||
], | ||
resolve: { | ||
extensions: ['.js', '.ts', '.tsx'] | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug #2: React event handlers shouldn't be null.