Skip to content

Commit d4223ab

Browse files
authored
Fix exports for space sub-config (#89)
1 parent e652772 commit d4223ab

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"type": "module",
1414
"exports": {
1515
".": "./index.js",
16-
"./space": "space.js"
16+
"./space": "./space.js"
1717
},
1818
"sideEffects": false,
1919
"engines": {

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add some ESLint config to your package.json (or `.eslintrc`):
2222

2323
```js
2424
// eslint.config.js
25-
import xoTypeScript from 'eslint-plugin-xo-typescript';
25+
import xoTypeScript from 'eslint-config-xo-typescript';
2626

2727
export default [
2828
...xoTypeScript,
@@ -32,7 +32,7 @@ export default [
3232
Use the `space` sub-config if you want 2 space indentation instead of tabs:
3333

3434
```js
35-
import xoTypeScriptSpace from 'eslint-plugin-xo-typescript/space';
35+
import xoTypeScriptSpace from 'eslint-config-xo-typescript/space';
3636

3737
export default [
3838
...xoTypeScriptSpace,

space.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
'use strict';
2-
const path = require('path');
1+
import eslintConfigXo from './index.js';
32

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-
};
3+
const [config] = eslintConfigXo;
4+
5+
export default [
6+
{
7+
...config,
8+
rules: {
9+
...config.rules,
10+
'@stylistic/indent': [
11+
'error',
12+
2,
13+
{
14+
SwitchCase: 1,
15+
},
16+
],
17+
},
18+
},
19+
];

0 commit comments

Comments
 (0)