Skip to content

Commit

Permalink
Use @vue/tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Mar 25, 2024
1 parent 145ea32 commit e10e501
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 31 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/tsconfig": "^0.5.1",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.23.0",
"sass": "^1.72.0",
Expand Down
14 changes: 7 additions & 7 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import {
} from 'vue';
import brace, {
Position,
IEditSession,
Editor as IEditor,
type Position,
type IEditSession,
type Editor,
} from 'brace';
import 'brace/theme/tomorrow';
import 'brace/ext/language_tools';
import '@/editor/rdt';
import ISelection from '@/types/selection';
import IIcon from '@/types/icon';
import type ISelection from '@/types/selection';
import type IIcon from '@/types/icon';
import useClientSize from '@/composables/useClientSize';
import bindEditorValue from '@/composables/bindEditorValue';
Expand All @@ -40,7 +40,7 @@ const props = defineProps<{
}>();
const holder = ref<HTMLElement>();
const editor = ref<IEditor>();
const editor = ref<Editor>();
const content = defineModel<string>('content');
bindEditorValue(editor, content);
Expand Down Expand Up @@ -71,7 +71,7 @@ const holderSize = useClientSize(holder);
watch(holderSize, () => editor.value?.resize());
function getCompletions(
_editor: IEditor,
_editor: Editor,
_session: IEditSession,
_pos: Position,
_prefix: string,
Expand Down
2 changes: 1 addition & 1 deletion src/composables/bindEditorSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Editor, Range, VirtualRenderer } from 'brace';

import onRefAssigned from './onRefAssigned';

import ISelection from '@/types/selection';
import type ISelection from '@/types/selection';

interface Renderer extends VirtualRenderer {
scrollTop: number;
Expand Down
2 changes: 1 addition & 1 deletion src/stores/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { ref, watch } from 'vue';
import { debounce } from 'radash';

import ISelection from '@/types/selection';
import type ISelection from '@/types/selection';

const debouncedSetItem = debounce({ delay: 200 }, localStorage.setItem.bind(localStorage));

Expand Down
2 changes: 1 addition & 1 deletion src/stores/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
import { ref } from 'vue';
import md5 from 'md5';

import IIcon from '@/types/icon';
import type IIcon from '@/types/icon';

const baseUrl = 'https://upload.wikimedia.org/wikipedia/commons';

Expand Down
25 changes: 5 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
"src/*",
],
},
"types": [
"naive-ui/volar"
"vite/client",
"naive-ui/volar",
],
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost",
]
},
"include": [
"src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resolve } from 'path';
export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, './src'),
'@': resolve('./src'),
},
},
plugins: [
Expand Down

0 comments on commit e10e501

Please sign in to comment.