You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-133
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ _"This guide is a **living compendium** documenting the most important patterns
17
17
### Complementary Libraries
18
18
-[utility-types](https://github.com/piotrwitek/utility-types) - Collection of generic types for TypeScript, complementing built-in mapped types and aliases - think lodash for reusable types.
19
19
-[typesafe-actions](https://github.com/piotrwitek/typesafe-actions) - Typesafe utilities for "action-creators" in Redux / Flux Architecture
20
+
-[react-redux-typescript-scripts](https://github.com/piotrwitek/react-redux-typescript-scripts) - dev-tools configuration files shared between projects based on this guide
We have our own recommended `tsconfig.json` that you can easily add to your project thanks to [`react-redux-typescript-scripts`](https://github.com/piotrwitek/react-redux-typescript-scripts) package.
1512
+
1513
+
#### tsconfig.json
1514
+
<details><summary><i>Click to expand</i></summary><p>
This library will cut down on your bundle size, thanks to using external runtime helpers instead of adding them per each file.
1534
+
1535
+
> Installation
1536
+
`npmitslib`
1537
+
1538
+
Then add this to your `tsconfig.json`:
1539
+
```ts
1540
+
"compilerOptions": {
1541
+
"importHelpers": true
1542
+
}
1543
+
```
1544
+
1545
+
[⇧ back to top](#table-of-contents)
1492
1546
1493
1547
## TSLint
1548
+
https://palantir.github.io/tslint/
1494
1549
1495
1550
> Installation
1496
1551
`npmi-Dtslint`
1497
1552
1498
-
#### tslint.json
1499
-
- Recommended setup is to extend build-in preset `tslint:recommended` (use `tslint:all` to enable all rules)
1500
-
- Add additional `react` specific rules: `npmi-Dtslint-react` https://github.com/palantir/tslint-react
1501
-
- Overwritten some defaults for more flexibility
1553
+
> For React project you should add additional `react` specific rules: `npmi-Dtslint-react` https://github.com/palantir/tslint-react
1554
+
1555
+
We have our own recommended config that you can easily add to your project thanks to [`react-redux-typescript-scripts`](https://github.com/piotrwitek/react-redux-typescript-scripts) package.
1502
1556
1557
+
#### tslint.json
1503
1558
<details><summary><i>Click to expand</i></summary><p>
- Recommended baseline config carefully optimized for strict type-checking and optimal webpack workflow
1664
-
- Install [`tslib`](https://www.npmjs.com/package/tslib) to cut on bundle size, by using external runtime helpers instead of adding them inline: `npmitslib`
1665
-
- Example "paths" setup for baseUrl relative imports with Webpack
1666
-
1667
-
<details><summary><i>Click to expand</i></summary><p>
1668
-
1669
-
```tsx
1670
-
{
1671
-
"compilerOptions": {
1672
-
"baseUrl": "./", // relative paths base
1673
-
"paths": {
1674
-
// "@src/*": ["src/*"] // will enable import aliases -> import { ... } from '@src/components'
1675
-
// WARNING: Require to add this to your webpack config -> resolve: { alias: { '@src': PATH_TO_SRC } }
1676
-
// "redux": ["typings/redux"], // override library types with your alternative type-definitions in typings folder
1677
-
"redux-thunk": ["typings/redux-thunk"] // override library types with your alternative type-definitions in typings folder
1678
-
},
1679
-
"outDir": "dist/", // target for compiled files
1680
-
"allowSyntheticDefaultImports": true, // no errors with commonjs modules interop
1681
-
"esModuleInterop": true, // enable to do "import React ..." instead of "import * as React ..."
1682
-
"allowJs": true, // include js files
1683
-
"checkJs": true, // typecheck js files
1684
-
"declaration": false, // don't emit declarations
1685
-
"emitDecoratorMetadata": true, // include only if using decorators
1686
-
"experimentalDecorators": true, // include only if using decorators
1687
-
"forceConsistentCasingInFileNames": true,
1688
-
"importHelpers": true, // importing transpilation helpers from tslib
1689
-
"noEmitHelpers": true, // disable inline transpilation helpers in each file
1690
-
"jsx": "react", // transform JSX
1691
-
"lib": ["dom", "es2017"], // you will need to include polyfills for es2017 manually
0 commit comments