diff --git a/.gitignore b/.gitignore index 2109e19..0eedb72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build node_modules package-lock.json +src/react-app-env.d.ts diff --git a/package.json b/package.json index 8870b04..369d728 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,14 @@ "@types/react-router-dom": "^4.3.1", "gh-pages": "^2.0.1", "prettier": "^1.15.3", - "react-scripts-ts": "^4.0.8", + "react-scripts": "^2.1.3", "tslint-config-prettier": "^1.17.0", "typescript": "latest" }, "scripts": { - "start": "react-scripts-ts start", - "build": "react-scripts-ts build", - "test": "react-scripts-ts test --env=jsdom", + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test --env=jsdom", "prettier": "prettier --write src/**/*.{ts,tsx,json}", "predeploy": "npm run build", "deploy": "gh-pages -d build" diff --git a/src/chart.tsx b/src/chart.tsx index b01a873..408fb1a 100644 --- a/src/chart.tsx +++ b/src/chart.tsx @@ -20,7 +20,7 @@ function zoomed() { /** Called when the scrollbars are used. */ function scrolled() { const svg = d3.select('#chart'); - const parent = (svg.node() as HTMLElement).parentElement!; + const parent = (svg.node() as HTMLElement).parentElement as Element; const x = parent.scrollLeft + parent.clientWidth / 2; const y = parent.scrollTop + parent.clientHeight / 2; d3.select(parent).call(d3.zoom().translateTo, x, y); @@ -59,7 +59,7 @@ export class Chart extends React.PureComponent { baseGeneration: this.props.selection.generation, }); const svg = d3.select('#chart'); - const parent = (svg.node() as HTMLElement).parentElement!; + const parent = (svg.node() as HTMLElement).parentElement as Element; d3.select(parent) .on('scroll', scrolled) diff --git a/src/chart_view.tsx b/src/chart_view.tsx index 8b7efc5..6eaa337 100644 --- a/src/chart_view.tsx +++ b/src/chart_view.tsx @@ -1,7 +1,7 @@ -import * as md5 from 'md5'; import * as queryString from 'query-string'; import * as React from 'react'; import axios from 'axios'; +import md5 from 'md5'; import {Chart} from './chart'; import {convertGedcom} from './gedcom_util'; import {IndiInfo, JsonGedcomData} from 'topola'; diff --git a/src/index.tsx b/src/index.tsx index 51ad9c2..3a822c3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,8 +1,8 @@ import * as locale_en from 'react-intl/locale-data/en'; import * as locale_pl from 'react-intl/locale-data/pl'; -import * as messages_pl from './translations/pl.json'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; +import messages_pl from './translations/pl.json'; import {addLocaleData} from 'react-intl'; import {ChartView} from './chart_view'; import {HashRouter as Router, Route, Switch} from 'react-router-dom'; diff --git a/src/top_bar.tsx b/src/top_bar.tsx index 010f32a..3402def 100644 --- a/src/top_bar.tsx +++ b/src/top_bar.tsx @@ -1,6 +1,6 @@ -import * as md5 from 'md5'; import * as queryString from 'query-string'; import * as React from 'react'; +import md5 from 'md5'; import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; import {RouteComponentProps} from 'react-router-dom'; diff --git a/tsconfig.json b/tsconfig.json index 3e852eb..4c0ca24 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,32 +1,25 @@ { "compilerOptions": { - "baseUrl": ".", - "outDir": "build/dist", - "module": "esnext", "target": "es5", - "lib": ["es6", "dom"], - "sourceMap": true, + "lib": [ + "dom", + "esnext" + ], "allowJs": true, - "jsx": "react", - "moduleResolution": "node", - "rootDir": "src", - "types": [], + "skipLibCheck": true, + "esModuleInterop": true, + "strict": true, "forceConsistentCasingInFileNames": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noImplicitAny": true, - "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, - "noUnusedLocals": true, - "resolveJsonModule": true + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "allowSyntheticDefaultImports": true, + "suppressImplicitAnyIndexErrors": true }, - "exclude": [ - "node_modules", - "build", - "scripts", - "acceptance-tests", - "webpack", - "jest", - "src/setupTests.ts" + "include": [ + "src" ] } diff --git a/tsconfig.prod.json b/tsconfig.prod.json deleted file mode 100644 index 714d1cd..0000000 --- a/tsconfig.prod.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "./tsconfig.json" }