From 98a711fea8b072612fbaef4c02300617e441823a Mon Sep 17 00:00:00 2001 From: alvarosabu Date: Wed, 25 Sep 2024 16:04:07 +0200 Subject: [PATCH] feat: semicolon rule --- README.md | 8 ++++---- eslint.config.ts | 4 ++-- src/index.ts | 16 ++++++++-------- src/rules/antfu.ts | 8 +++++--- src/rules/base.ts | 4 ++-- src/rules/nuxt.ts | 4 ++-- tsup.config.ts | 4 ++-- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 1532dc1..6a2b366 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -99,7 +99,7 @@ export default storyblokLintConfig( curly: 'off', }, }, -) +); ``` ## 📝 VS Code Support diff --git a/eslint.config.ts b/eslint.config.ts index 912b2b6..5607a04 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,3 +1,3 @@ -import { storyblokLintConfig } from './src/index' +import { storyblokLintConfig } from './src/index'; -export default storyblokLintConfig() +export default storyblokLintConfig(); diff --git a/src/index.ts b/src/index.ts index ade8e5b..a7e8c7f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 = {}, @@ -17,10 +17,10 @@ const storyblokLintConfig = ( // Addtionals flat configs start from here base as TypedFlatConfigItem, ...configs, - ) -} + ); +}; export { nuxt, storyblokLintConfig, -} +}; diff --git a/src/rules/antfu.ts b/src/rules/antfu.ts index 87fce4f..e795d86 100644 --- a/src/rules/antfu.ts +++ b/src/rules/antfu.ts @@ -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; diff --git a/src/rules/base.ts b/src/rules/base.ts index a7f7344..8466caf 100644 --- a/src/rules/base.ts +++ b/src/rules/base.ts @@ -30,6 +30,6 @@ const baseConfig = [ }], }, }, -] +]; -export default baseConfig +export default baseConfig; diff --git a/src/rules/nuxt.ts b/src/rules/nuxt.ts index 13d42ef..227211d 100644 --- a/src/rules/nuxt.ts +++ b/src/rules/nuxt.ts @@ -29,6 +29,6 @@ const nuxtConfig = [ 'vue/no-multiple-template-root': 'error', }, }, -] +]; -export default nuxtConfig +export default nuxtConfig; diff --git a/tsup.config.ts b/tsup.config.ts index ea075be..4b50c67 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'tsup' +import { defineConfig } from 'tsup'; export default defineConfig({ entry: [ @@ -6,4 +6,4 @@ export default defineConfig({ 'src/cli.ts', ], shims: true, -}) +});