Skip to content

Commit 915059d

Browse files
authored
Add space sub-config (#22)
1 parent da32f1e commit 915059d

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"test": "ava"
1818
},
1919
"files": [
20-
"index.js"
20+
"index.js",
21+
"space.js"
2122
],
2223
"keywords": [
2324
"typescript",

readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ Add some ESLint config to your package.json (or `.eslintrc`):
2424
}
2525
```
2626

27+
Use the `space` sub-config if you want 2 space indentation instead of tabs:
28+
29+
```json
30+
{
31+
"name": "my-awesome-project",
32+
"eslintConfig": {
33+
"extends": [
34+
"xo",
35+
"xo-typescript/space"
36+
]
37+
}
38+
}
39+
```
40+
2741
*Note:* If your `tsconfig.json` is not in the same directory as `package.json`, you will have to set the path yourself:
2842

2943
```json

space.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
const path = require('path');
3+
4+
module.exports = {
5+
extends: path.join(__dirname, 'index.js'),
6+
rules: {
7+
'@typescript-eslint/indent': [
8+
'error',
9+
2,
10+
{
11+
SwitchCase: 1
12+
}
13+
]
14+
}
15+
};

0 commit comments

Comments
 (0)