Skip to content

Commit 5566785

Browse files
committed
fix(typescript): added typescript support
1 parent 25568f4 commit 5566785

29 files changed

+453
-64
lines changed

build.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default defineBuildConfig({
1414
jsxFactory: 'h'
1515
}
1616
},
17-
{ builder: 'mkdist', input: './src', pattern: ['**/*.js'], format: 'cjs', loaders: ['js'], ext: 'cjs' },
18-
{ builder: 'mkdist', input: './src', pattern: ['**/*.js'], format: 'esm', loaders: ['js'], ext: 'js' }
17+
{ builder: 'mkdist', input: './src', pattern: ['**/*.ts'], format: 'cjs', loaders: ['js'], ext: 'cjs' },
18+
{ builder: 'mkdist', input: './src', pattern: ['**/*.ts'], format: 'esm', loaders: ['js'], ext: 'js' }
1919
],
2020
declaration: true,
2121
clean: true,

docs/.vitepress/config.js renamed to docs/.vitepress/config.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
// import { defineConfig } from 'vitepress';
2-
3-
// // https://vitepress.dev/reference/site-config
4-
// export default defineConfig({
5-
// title: 'Vue Semantic Structure',
6-
// description: 'Helper for semantic HTML structure.',
7-
// themeConfig: {
8-
// // https://vitepress.dev/reference/default-theme-config
9-
// }
10-
// });
11-
121
import { fileURLToPath } from 'url';
13-
import { defineConfig } from 'vitepress';
2+
import { DefaultTheme, defineConfig, ThemeOptions, UserConfig } from 'vitepress';
143
import markdownItInlineComments from 'markdown-it-inline-comments';
154
import navigation from './navigation.js';
165

17-
// https://vitepress.dev/reference/site-config
18-
export default defineConfig(() => ({
6+
export default defineConfig({
197
head: [
208
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }],
219

@@ -68,7 +56,12 @@ export default defineConfig(() => ({
6856
sitemap: {
6957
hostname: 'https://basics.github.io/vue-semantic-structure/'
7058
}
71-
}));
59+
} as UserConfig<DefaultTheme.Config> & {
60+
themeConfig: ThemeOptions & {
61+
logoComponent: boolean;
62+
socialLinks: { icon: string; link: string }[];
63+
};
64+
});
7265

7366
function getBaseUrl() {
7467
return process.env.npm_config_base_url || process.env.BASE_URL || '/';
File renamed without changes.
File renamed without changes.

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import pluginJs from '@eslint/js';
33
import pluginVue from 'eslint-plugin-vue';
44
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
55
import eslintIgnores from './eslint.ignores.js';
6+
import tseslint from 'typescript-eslint';
67

78
export default [
89
eslintIgnores,
910
pluginJs.configs.recommended,
11+
...tseslint.configs.recommended,
1012
...pluginVue.configs['flat/essential'],
1113
eslintPluginPrettierRecommended,
1214
{

0 commit comments

Comments
 (0)