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
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -439,6 +439,54 @@ For developing with Storybook, read the docs I maintain over here: <https://stor
439
439
440
440
We have an active discussion on Linting [here](https://github.com/sw-yx/react-typescript-cheatsheet/issues/7).
441
441
442
+
To user prettier with TSLint you will need [`tslint-config-prettier`](https://github.com/alexjoverm/tslint-config-prettier) which disables all conflicting rules and optionally [`tslint-plugin-prettier`](https://github.com/ikatyang/tslint-plugin-prettier) which will highlight differences as TSLint issues.
443
+
444
+
Example configuration:
445
+
446
+
<table>
447
+
<tr>
448
+
<th>
449
+
<strong>tslint.json</strong>
450
+
</th>
451
+
<th>
452
+
<strong>.prettierrc</strong>
453
+
</th>
454
+
</tr>
455
+
<tr>
456
+
<td>
457
+
<pre>
458
+
{
459
+
"rulesDirectory": ["tslint-plugin-prettier"],
460
+
"extends": [
461
+
"tslint:recommended",
462
+
"tslint-config-prettier"
463
+
],
464
+
"linterOptions": {
465
+
"exclude": ["node_modules/**/*.ts"]
466
+
},
467
+
"rules": {
468
+
"prettier": true
469
+
}
470
+
}
471
+
</pre>
472
+
</td>
473
+
<td>
474
+
<pre>
475
+
{
476
+
"printWidth": 89,
477
+
"tabWidth": 2,
478
+
"useTabs": false,
479
+
"semi": true,
480
+
"singleQuote": true,
481
+
"trailingComma": "all",
482
+
"bracketSpacing": true,
483
+
"jsxBracketSameLine": false
484
+
}
485
+
</pre>
486
+
</td>
487
+
</tr>
488
+
</table>
489
+
442
490
## Working with Non-Typescript Libraries (writing your own index.d.ts)
0 commit comments