Skip to content

Commit

Permalink
Fix exports for space sub-config (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeskunall authored Sep 22, 2024
1 parent e652772 commit d4223ab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "module",
"exports": {
".": "./index.js",
"./space": "space.js"
"./space": "./space.js"
},
"sideEffects": false,
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Add some ESLint config to your package.json (or `.eslintrc`):

```js
// eslint.config.js
import xoTypeScript from 'eslint-plugin-xo-typescript';
import xoTypeScript from 'eslint-config-xo-typescript';

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

```js
import xoTypeScriptSpace from 'eslint-plugin-xo-typescript/space';
import xoTypeScriptSpace from 'eslint-config-xo-typescript/space';

export default [
...xoTypeScriptSpace,
Expand Down
32 changes: 18 additions & 14 deletions space.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
'use strict';
const path = require('path');
import eslintConfigXo from './index.js';

module.exports = {
extends: path.join(__dirname, 'index.js'),
rules: {
'@typescript-eslint/indent': [
'error',
2,
{
SwitchCase: 1
}
]
}
};
const [config] = eslintConfigXo;

export default [
{
...config,
rules: {
...config.rules,
'@stylistic/indent': [
'error',
2,
{
SwitchCase: 1,
},
],
},
},
];

0 comments on commit d4223ab

Please sign in to comment.