Skip to content

Commit

Permalink
chore: typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
astahmer committed Dec 10, 2024
1 parent cd2883e commit c1ea03d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/plugins/optimize-lightningcss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function optimizeLightCss(code: string | Root, options: OptimizeO

const codeStr = typeof code === 'string' ? code : code.toString()
const result = transform({
code: Buffer.from(codeStr),
// https://stackoverflow.com/questions/78790943/in-typescript-5-6-buffer-is-not-assignable-to-arraybufferview-or-uint8arr
code: Buffer.from(codeStr) as any as Uint8Array,
minify,
sourceMap: false,
filename: 'styles.css',
Expand Down
2 changes: 1 addition & 1 deletion packages/extractor/__tests__/extract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { default as ExtractSample } from './samples/ExtractSample?raw'

const project = createProject()

let sourceFile: SourceFile
let sourceFile: SourceFile | undefined
afterEach(() => {
if (!sourceFile) return

Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/vue-to-tsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const NodeTypes = {
export const vueToTsx = (code: string) => {
try {
const parsed = parse(code)
const fileStr = new MagicString(`<template>${parsed.descriptor.template?.content}</template>` ?? '')
const fileStr = new MagicString(`<template>${parsed.descriptor.template?.content}</template>`)

const rewriteProp = (prop: BaseElementNode['props'][number]) => {
if (
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export function traverse(obj: any, callback: CallbackFn, options: TraverseOption
const keys = Object.keys(currentItem.value)
for (let i = keys.length - 1; i >= 0; i--) {
const key = keys[i]
const value = currentItem.value[key]
const value = (currentItem.value as Record<string, unknown>)[key]

const path = currentItem.path ? currentItem.path + separator + key : key
const paths = currentItem.paths.concat(key)

stack.push({
value,
value: value as Record<string, unknown>,
path,
paths,
depth: currentItem.depth + 1,
parent: currentItem.value,
parent: currentItem.value as Record<string, unknown>,
key,
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/types/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const main = () => {
files.forEach((file) => {
const destFile = path.join('dist', file.endsWith('.d.ts') ? file : toDts(file))
getOrCreateDir('dist')
const content = fs.readFileSync(path.join('src', file))
const content = fs.readFileSync(path.join('src', file as string))
fs.writeFileSync(destFile, content)

Check failure on line 23 in packages/types/scripts/build.ts

View workflow job for this annotation

GitHub Actions / TypeScript

Argument of type 'Buffer' is not assignable to parameter of type 'string | ArrayBufferView'.
})
}
Expand Down

0 comments on commit c1ea03d

Please sign in to comment.