Skip to content

Commit

Permalink
fix: neglect use prefix in composables name (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhamfarrag authored Sep 22, 2024
1 parent bb11ae9 commit cc48b77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@
"changelogen": "^0.5.7",
"eslint": "^9.11.0",
"eslint-config-unjs": "^0.3.2",
"knip": "^5.30.2",
"knip": "^5.30.4",
"nuxi-nightly": "^3.14.0-20240921-193235-ef57bb1",
"taze": "^0.16.9",
"terser": "^5.33.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

6 changes: 4 additions & 2 deletions src/commands/composable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { window } from 'vscode'
import { composableTemplate } from '../templates'
import { createDir, createFile, createSubFolders, normalizeFileExtension, projectSrcDirectory, showSubFolderQuickPick } from '../utils'

const neglectUsePrefix = (name: string) => name.replace(/^use/i, '')

const createComposable = () => {
window
.showInputBox({
Expand All @@ -22,7 +24,7 @@ const createComposable = () => {
name,
subFolders,
commandType: 'composables',
content: composableTemplate(name),
content: composableTemplate(neglectUsePrefix(name)),
})

})
Expand All @@ -41,7 +43,7 @@ const directCreateComposable = (path: string) => {

createFile({
fileName: `${name}.ts`,
content: composableTemplate(name),
content: composableTemplate(neglectUsePrefix(name)),
fullPath: filePath,
})
})
Expand Down

0 comments on commit cc48b77

Please sign in to comment.