Skip to content

Commit

Permalink
Merge pull request #1 from storyblok/feature/semicolon-rule
Browse files Browse the repository at this point in the history
feat: semicolon rule
  • Loading branch information
alvarosabu authored Sep 26, 2024
2 parents a7a748b + 98a711f commit dd0ab22
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Using the default config without arguments uses the following `@antfu/eslint-con

```js
// eslint.config.js
import { storyblokLintConfig } from '@storyblok/eslint-config'
import { storyblokLintConfig } from '@storyblok/eslint-config';

export default storyblokLintConfig()
export default storyblokLintConfig();
```

#### Setting options and using custom rules
Expand All @@ -86,7 +86,7 @@ It is possible to add custom rules with the following configuration.

```js
// eslint.config.js
import { storyblokLintConfig } from '@storyblok/eslint-config'
import { storyblokLintConfig } from '@storyblok/eslint-config';

export default storyblokLintConfig(
// @antfu/eslint-config options, must be the first argument
Expand All @@ -99,7 +99,7 @@ export default storyblokLintConfig(
curly: 'off',
},
},
)
);
```

## 📝 VS Code Support
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { storyblokLintConfig } from './src/index'
import { storyblokLintConfig } from './src/index';

export default storyblokLintConfig()
export default storyblokLintConfig();
16 changes: 8 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import antfu from '@antfu/eslint-config'
import type { Awaitable, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config'
import antfuOptions from './rules/antfu'
import base from './rules/base'
import nuxt from './rules/nuxt'
import antfu from '@antfu/eslint-config';
import type { Awaitable, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
import antfuOptions from './rules/antfu';
import base from './rules/base';
import nuxt from './rules/nuxt';

const storyblokLintConfig = (
options: OptionsConfig & TypedFlatConfigItem = {},
Expand All @@ -17,10 +17,10 @@ const storyblokLintConfig = (
// Addtionals flat configs start from here
base as TypedFlatConfigItem,
...configs,
)
}
);
};

export {
nuxt,
storyblokLintConfig,
}
};
8 changes: 5 additions & 3 deletions src/rules/antfu.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const antfuConfig = {
stylistic: true,
stylistic: {
semi: true,
},
// vue: true, // autodetected by @antfu/eslint-config, no need to set a default
// typescript: true, // autodetected by @antfu/eslint-config, no need to set a default
formatters: {
css: true,
html: true,
},
}
};

export default antfuConfig
export default antfuConfig;
4 changes: 2 additions & 2 deletions src/rules/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ const baseConfig = [
}],
},
},
]
];

export default baseConfig
export default baseConfig;
4 changes: 2 additions & 2 deletions src/rules/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ const nuxtConfig = [
'vue/no-multiple-template-root': 'error',
},
},
]
];

export default nuxtConfig
export default nuxtConfig;
4 changes: 2 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'tsup'
import { defineConfig } from 'tsup';

export default defineConfig({
entry: [
'src/index.ts',
'src/cli.ts',
],
shims: true,
})
});

0 comments on commit dd0ab22

Please sign in to comment.