Skip to content

Commit

Permalink
feat: change vue ignore comment (#46)
Browse files Browse the repository at this point in the history
* feat: change vue ignore comment

* chore: changeset
  • Loading branch information
junghyeonsu authored Jul 4, 2024
1 parent 34713db commit 3fa3adb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/smooth-doors-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@icona/generator": patch
"@icona/types": patch
---

change vue ignore comment
11 changes: 9 additions & 2 deletions packages/generator/src/core/vue2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ import {
getTargetPath,
makeFolderIfNotExistFromRoot,
} from "../utils/file";
import { generateIndexFileTemplate, ignores } from "../utils/template";
import {
generateIndexFileTemplate,
ignores,
vueIgnores,
} from "../utils/template";

const shimsTemplate = () => `${ignores}\ndeclare module "*.vue" {
import Vue from 'vue'
export default Vue
}\n`;

const componentTemplate = (name: string, svg: string) => `${ignores}\n<template>
const componentTemplate = (
name: string,
svg: string,
) => `${vueIgnores}\n<template>
${svg}</template>
<script lang="ts">
Expand Down
11 changes: 9 additions & 2 deletions packages/generator/src/core/vue3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
getTargetPath,
makeFolderIfNotExistFromRoot,
} from "../utils/file";
import { generateIndexFileTemplate, ignores } from "../utils/template";
import {
generateIndexFileTemplate,
ignores,
vueIgnores,
} from "../utils/template";

const shimsTemplate = () => `${ignores}\ndeclare module '*.vue' {
import type { DefineComponent } from 'vue'
Expand All @@ -19,7 +23,10 @@ const shimsTemplate = () => `${ignores}\ndeclare module '*.vue' {
}\n`;

// Vue 컴포넌트 템플릿
const componentTemplate = (name: string, svg: string) => `${ignores}\n<template>
const componentTemplate = (
name: string,
svg: string,
) => `${vueIgnores}\n<template>
${svg}</template>
<script lang="ts">
Expand Down
1 change: 1 addition & 0 deletions packages/generator/src/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface GenerateIndexFileTemplateProps {
}

export const ignores = `/* eslint-disable */ // @ts-nocheck @ts-ignore`;
export const vueIgnores = `<!-- eslint-disable --> <!-- @ts-nocheck @ts-ignore -->`;

export const generateIndexFileTemplate = (
props: GenerateIndexFileTemplateProps,
Expand Down

0 comments on commit 3fa3adb

Please sign in to comment.