Skip to content

Commit 86eb0e1

Browse files
committed
no type err on app folder
1 parent 94b3671 commit 86eb0e1

24 files changed

+386
-104
lines changed

package-lock.json

Lines changed: 306 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
{
22
"name": "reactime",
33
"description": "build web extension bundle.js",
4+
"jest": {
5+
"transform": {
6+
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
7+
},
8+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
9+
"moduleFileExtensions": [
10+
"ts",
11+
"tsx",
12+
"js"
13+
]
14+
},
415
"scripts": {
516
"build": "webpack --mode production",
617
"dev": "webpack --mode development --watch",
@@ -49,6 +60,8 @@
4960
"@babel/plugin-proposal-decorators": "^7.4.4",
5061
"@babel/preset-env": "^7.10.3",
5162
"@babel/preset-react": "^7.0.0",
63+
"@types/chrome": "0.0.119",
64+
"@types/jest": "^26.0.4",
5265
"babel-loader": "^8.0.6",
5366
"core-js": "^3.6.5",
5467
"css-loader": "^3.2.0",
@@ -69,6 +82,7 @@
6982
"sass-loader": "^7.2.0",
7083
"sinon-chrome": "^3.0.1",
7184
"style-loader": "^0.23.1",
85+
"ts-jest": "^26.1.1",
7286
"ts-loader": "^7.0.5",
7387
"typescript": "^3.9.6",
7488
"webpack": "^4.43.0",
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"compilerOptions": {
33
"outDir": "./Frontend/public",
4-
"sourceMap": true,
5-
"noImplicitAny": true,
6-
"module": "commonjs",
7-
"target": "es6",
4+
"module": "es6",
5+
"target": "es5",
86
"jsx": "react",
9-
"esModuleInterop": true
7+
"allowJs": true,
8+
"types": ["chrome", "jest"]
109
}
1110
}

src/app/__tests__/action.test.jsx renamed to src/app/__tests__/action.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ configure({ adapter: new Adapter() });
1010
describe('unit testing for Action.jsx', () => {
1111
let wrapper;
1212
const props = {
13+
key:'actions2',
1314
selected: true,
1415
last: false,
1516
index: 2,
File renamed without changes.

src/app/actions/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as types from '../constants/actionTypes.ts';
1+
import * as types from '../constants/actionTypes';
22

33
export const toggleMode = mode => ({
44
type: types.TOGGLE_MODE,

src/app/components/Action.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ import React from 'react';
22
import { changeView, changeSlider } from '../actions/actions';
33

44
interface ActionProps {
5+
key: string;
56
selected: boolean;
67
last: boolean;
78
index: number;
89
sliderIndex: number;
9-
dispatch: () => void;
10+
dispatch: (a:any) => void;
1011
displayName: string;
1112
componentName: string;
12-
componentData: {actualDuration: number};
13-
state: object;
13+
componentData: {actualDuration: number}|undefined;
14+
state?: object|string;
1415
viewIndex: number;
15-
handleOnkeyDown: (e: KeyboardEvent, i: number) => void;
16+
handleOnkeyDown: (e: any, i: number) => void;
1617
}
1718

1819
/* // gabi and nate :: index and delta props were removed from Action.jsx */
@@ -39,7 +40,8 @@ const Action = (props: ActionProps) => {
3940
} else {
4041
seconds = '00';
4142
}
42-
miliseconds = Number.parseFloat(miliseconds).toFixed(2);
43+
const convert:any = new Number()
44+
miliseconds = convert.parseFloat(miliseconds).toFixed(2);
4345
const arrayMiliseconds = miliseconds.split('.');
4446
if (arrayMiliseconds[0].length < 2) {
4547
arrayMiliseconds[0] = '0'.concat(arrayMiliseconds[0]);
@@ -54,9 +56,9 @@ const Action = (props: ActionProps) => {
5456
return (
5557
<div
5658
// Edwin: invoking keyboard functionality; functionality is in ActionContainer;
57-
onKeyDown={(e: KeyboardEvent) => handleOnkeyDown(e, viewIndex)}
59+
onKeyDown={(e:any) => handleOnkeyDown(e, viewIndex)}
5860
className={selected || last ? 'action-component selected' : 'action-component'}
59-
onClick={(e: MouseEvent) => {
61+
onClick={() => {
6062
dispatch(changeView(index));
6163
}}
6264
role="presentation"
@@ -74,7 +76,7 @@ const Action = (props: ActionProps) => {
7476
</button>
7577
<button
7678
className="jump-button"
77-
onClick={(e: MouseEvent) => {
79+
onClick={(e:any) => {
7880
e.stopPropagation();
7981
dispatch(changeSlider(index));
8082
dispatch(changeView(index));

src/app/components/Chart.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import React, { Component } from 'react';
1515
import * as d3 from 'd3';
1616

1717
const colors = ['#95B6B7', '#475485', '#519331', '#AA5039', '#8B2F5F', '#C5B738', '#858DFF', '#FF8D02', '#FFCD51', '#ACDAE6', '#FC997E', '#CF93AD', '#AA3939', '#AA6C39', '#226666', '#2C4870'];
18+
1819
interface ChartProps {
19-
chartRef:any;
20-
maked3Tree: any;
21-
removed3Tree: any;
20+
hierarchy: object;
2221
}
2322

2423
let root = {};

src/app/components/Diff.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ReactHtmlParser from 'react-html-parser';
44
import { useStoreContext } from '../store';
55

66
interface DiffProps {
7-
snapshot: {state:object|string};
7+
snapshot: {state?:object|string};
88
show?: boolean|undefined;
99
}
1010

@@ -23,7 +23,7 @@ function Diff(props: DiffProps) {
2323
}
2424

2525
// gabi :: cleanning preview from stateless data
26-
const statelessCleanning = (obj:{name?:string; componentData?:object; state?:object|string;stateSnaphot?:object; children?:[]}) => {
26+
const statelessCleanning = (obj:{name?:string; componentData?:object; state?:object|string;stateSnaphot?:object; children?:any[]}) => {
2727
const newObj = { ...obj };
2828
if (newObj.name === 'nameless') {
2929
delete newObj.name;

src/app/components/DiffRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
import Diff from './Diff';
66

77

8-
const DiffRoute = (props: {snapshot: {state: string | object; children?:[]}}) => (
8+
const DiffRoute = (props: {snapshot: { name?: string; componentData?: object; state?: string | object; stateSnaphot?: object; children?: any[]; }}) => (
99

1010
<Router>
1111
<div className="navbar">

0 commit comments

Comments
 (0)