Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 2, 2024
1 parent f923435 commit 52dca13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 116 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
},
"devDependencies": {
"@swc/core": "^1.7.22",
"@sxzz/eslint-config": "^4.1.0",
"@sxzz/eslint-config": "^4.1.1",
"@sxzz/prettier-config": "^2.0.2",
"@types/node": "^20.16.3",
"bumpp": "^9.5.2",
Expand Down
120 changes: 8 additions & 112 deletions pnpm-lock.yaml

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

8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export const IsolatedDecl: UnpluginInstance<Options | undefined, false> =
const filter = createFilter(options.include, options.exclude)

const outputFiles: Record<string, string> = {}
function stripExt(filename: string) {
return filename.replace(/\.(.?)[jt]s$/, '')
}

function addOutput(filename: string, source: string) {
outputFiles[stripExt(filename)] = source
}
Expand Down Expand Up @@ -216,6 +214,10 @@ export const IsolatedDecl: UnpluginInstance<Options | undefined, false> =
}
})

function stripExt(filename: string) {
return filename.replace(/\.(.?)[jt]s$/, '')
}

export function lowestCommonAncestor(...filepaths: string[]): string {
if (filepaths.length === 0) return ''
if (filepaths.length === 1) return path.dirname(filepaths[0])
Expand Down

0 comments on commit 52dca13

Please sign in to comment.