Skip to content

Commit a3625cf

Browse files
first draft of typescript (#101)
1 parent 99adc6d commit a3625cf

File tree

7 files changed

+105
-28
lines changed

7 files changed

+105
-28
lines changed

Diff for: .eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
globals: {
3+
__PATH_PREFIX__: true,
4+
},
5+
extends: `react-app`,
6+
};

Diff for: package-lock.json

+55-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"start": "npm run develop",
99
"build": "gatsby build --prefix-paths",
1010
"serve": "gatsby serve",
11-
"deploy": "rm -rf node_modules/.cache/gh-pages && npm run build && gh-pages -d public -b public"
11+
"deploy": "rm -rf node_modules/.cache/gh-pages && npm run build && gh-pages -d public -b public",
12+
"type-check": "tsc --noEmit",
13+
"lint": "eslint . --ignore-path .gitignore --ext .ts,.tsx,.js"
1214
},
1315
"dependencies": {
1416
"@stackbit/gatsby-plugin-menus": "0.0.4",
@@ -38,6 +40,15 @@
3840
"sprintf-js": "^1.1.2"
3941
},
4042
"devDependencies": {
41-
"gh-pages": "^3.1.0"
43+
"@types/react": "17.0.3",
44+
"@types/react-dom": "17.0.2",
45+
"@typescript-eslint/eslint-plugin": "4.18.0",
46+
"@typescript-eslint/parser": "4.18.0",
47+
"eslint": "7.22.0",
48+
"eslint-config-prettier": "8.1.0",
49+
"eslint-plugin-prettier": "3.3.1",
50+
"gh-pages": "3.1.0",
51+
"prettier": "2.2.1",
52+
"typescript": "4.2.3"
4253
}
4354
}
File renamed without changes.

Diff for: src/components/Video.js

-14
This file was deleted.

Diff for: src/components/Video.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import ReactPlayer from "react-player";
3+
import _ from "lodash";
4+
5+
export default class Video extends React.Component {
6+
render() {
7+
const section = _.get(this.props, `section`, null);
8+
return (
9+
<div className="container container--md align-center">
10+
<ReactPlayer url={section.url} />
11+
<br />
12+
</div>
13+
);
14+
}
15+
}

Diff for: tsconfig.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2019",
4+
"module": "CommonJS",
5+
"lib": ["dom", "es2017"],
6+
// "allowJs": true,
7+
// "checkJs": true,
8+
"jsx": "react",
9+
"strict": true,
10+
"esModuleInterop": true,
11+
"experimentalDecorators": true,
12+
"emitDecoratorMetadata": true,
13+
"noEmit": true,
14+
"skipLibCheck": true
15+
}
16+
}

0 commit comments

Comments
 (0)