Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit de4c83b

Browse files
authored
Merge pull request #104 from skellock/stricter-ts
🔨 Adds stricter type checking and linting.
2 parents 3f8ca84 + 6ca8b1d commit de4c83b

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"ts-loader": "^3.2.0",
109109
"ts-node": "^3.3.0",
110110
"tslint": "^5.8.0",
111+
"tslint-config-prettier": "^1.6.0",
111112
"typescript": "~2.6.2"
112113
},
113114
"jest": {

src/main/main-window/main-window.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createMainWindow } from './main-window'
2+
// @ts-ignore
23
import * as containDeep from 'jest-expect-contain-deep'
34
import { BrowserWindow } from 'electron'
45
const WindowStateManager = require('electron-window-state-manager')

src/renderer/platform/components/tab/tab.story.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
import * as React from 'react'
22
import { StorybookStory as Story, StorybookGroup as Group } from '../storybook'
3-
43
import { storiesOf } from '@storybook/react'
54
import { Tab } from './index'
5+
// @ts-ignore
66
import { Value } from 'react-powerplug'
77

88
storiesOf('Tab', module).add('Tab', () => (
99
<Story>
1010
<Group title='inactive'>
1111
<Value initial='three'>
12-
{({ value, setValue }) => (
13-
<div style={{ flexDirection: 'row', display: 'flex' }}>
14-
<Tab text='One' active={value === 'one'} onClick={() => setValue('one')} />
15-
<Tab text='Two' active={value === 'two'} onClick={() => setValue('two')} />
16-
<Tab text='Three' active={value === 'three'} onClick={() => setValue('three')} />
17-
<Tab text='Four' active={value === 'four'} onClick={() => setValue('four')} />
18-
</div>
19-
)}
12+
{(arg: any) => {
13+
const { value, setValue } = arg
14+
return (
15+
<div style={{ flexDirection: 'row', display: 'flex' }}>
16+
<Tab text='One' active={value === 'one'} onClick={() => setValue('one')} />
17+
<Tab text='Two' active={value === 'two'} onClick={() => setValue('two')} />
18+
<Tab text='Three' active={value === 'three'} onClick={() => setValue('three')} />
19+
<Tab text='Four' active={value === 'four'} onClick={() => setValue('four')} />
20+
</div>
21+
)
22+
}}
2023
</Value>
2124
</Group>
2225
</Story>

tsconfig.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
"jsx": "react",
77
"experimentalDecorators": true,
88
"allowSyntheticDefaultImports": false,
9-
"strict": false,
109
"noUnusedLocals": true,
11-
"inlineSourceMap": true
10+
"inlineSourceMap": true,
11+
"strictNullChecks": true,
12+
"noImplicitReturns": true,
13+
"noImplicitAny": true
1214
},
13-
"include": [
14-
"src",
15-
"typings",
16-
"fuse.ts"
17-
]
15+
"include": ["src", "typings", "fuse.ts"]
1816
}

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "tslint-config-prettier",
23
"rules": {
34
"ordered-imports": [false],
45
"quotemark": [true, "single", "jsx-single", "avoid-escape"],

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7338,6 +7338,10 @@ tslib@^1.7.1:
73387338
version "1.8.1"
73397339
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac"
73407340

7341+
tslint-config-prettier@^1.6.0:
7342+
version "1.6.0"
7343+
resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.6.0.tgz#fec1ee8fb07e8f033c63fed6b135af997f31962a"
7344+
73417345
tslint@^5.8.0:
73427346
version "5.8.0"
73437347
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.8.0.tgz#1f49ad5b2e77c76c3af4ddcae552ae4e3612eb13"

0 commit comments

Comments
 (0)