Skip to content

Commit 957b0d9

Browse files
jorgegonzalezsindresorhus
authored andcommitted
Add support for TypeScript and document usage with Flow (#326)
1 parent a28625a commit 957b0d9

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

lib/options-manager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const DEFAULT_IGNORE = [
2727

2828
const DEFAULT_EXTENSION = [
2929
'js',
30-
'jsx'
30+
'jsx',
31+
'ts',
32+
'tsx'
3133
];
3234

3335
const DEFAULT_CONFIG = {

readme.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,17 @@ Enforce ES2015+ rules. Disabling this will make it not *enforce* ES2015+ syntax
267267
*ES2015+ is parsed even without this option. You can already use ES2017 features like [`async`/`await`](https://github.com/lukehoban/ecmascript-asyncawait).
268268

269269

270+
## TypeScript and Flow
271+
272+
### TypeScript
273+
274+
See [eslint-config-xo-typescript#use-with-xo](https://github.com/xojs/eslint-config-xo-typescript#use-with-xo)
275+
276+
### Flow
277+
278+
See [eslint-config-xo-flow#use-with-xo](https://github.com/xojs/eslint-config-xo-flow#use-with-xo)
279+
280+
270281
## Config Overrides
271282

272283
XO makes it easy to override configs for specific files. The `overrides` property must be an array of override objects. Each override object must contain a `files` property which is a glob string, or an array of glob strings. The remaining properties are identical to those described above, and will override the settings of the base config. If multiple override configs match the same file, each matching override is applied in the order it appears in the array. This means the last override in the array takes precedence over earlier ones. Consider the following example:
@@ -358,10 +369,6 @@ The [Standard style](http://standardjs.com) is a really cool idea. I too wish we
358369

359370
XO is based on ESLint. This project started out as just a shareable ESLint config, but it quickly grew out of that. I wanted something even simpler. Just typing `xo` and be done. No decision-making. No config. I also have some exciting future plans for it. However, you can still get most of the XO benefits while using ESLint directly with the [ESLint shareable config](https://github.com/xojs/eslint-config-xo).
360371

361-
#### Does it support TypeScript?
362-
363-
Not yet, but we have a [shareable config for TSLint](https://github.com/xojs/tslint-xo).
364-
365372

366373
## Editor plugins
367374

@@ -391,6 +398,8 @@ Not yet, but we have a [shareable config for TSLint](https://github.com/xojs/tsl
391398
- [stylelint-config-xo](https://github.com/xojs/stylelint-config-xo) - Stylelint shareable config for XO with tab indent
392399
- [stylelint-config-xo-space](https://github.com/xojs/stylelint-config-xo-space) - Stylelint shareable config for XO with 2-space indent
393400
- [tslint-xo](https://github.com/xojs/tslint-xo) - TSLint shareable config for XO
401+
- [eslint-config-xo-typescript](https://github.com/xojs/eslint-config-xo-typescript) - ESLint shareable config for TypeScript
402+
- [eslint-config-xo-flow](https://github.com/xojs/eslint-config-xo-flow) - ESLint shareable config for Flow
394403

395404

396405
## Support

0 commit comments

Comments
 (0)