Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 11, 2023
1 parent 3be4e3c commit 623ba51
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"size-baseline": "node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli",
"check": "tsc --incremental --noEmit",
"lint": "eslint --cache --ext .ts packages/*/{src,__tests__}/**.ts",
"format": "prettier --write --cache --parser typescript \"**/*.[tj]s?(x)\"",
"format-check": "prettier --check --cache --parser typescript \"**/*.[tj]s?(x)\"",
"format": "prettier --write --cache \"**/*.[tj]s?(x)\"",
"format-check": "prettier --check --cache \"**/*.[tj]s?(x)\"",
"test": "vitest",
"test-unit": "vitest -c vitest.unit.config.ts",
"test-e2e": "node scripts/build.js vue -f global -d && vitest -c vitest.e2e.config.ts",
Expand Down Expand Up @@ -84,7 +84,7 @@
"marked": "^4.0.10",
"minimist": "^1.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"prettier": "^3.0.1",
"pug": "^3.0.1",
"puppeteer": "~19.6.0",
"rollup": "^3.26.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/compiler-sfc/src/script/importUsageCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ function resolveTemplateUsageCheckString(sfc: SFCDescriptor) {
)}`
}
}
if (prop.type === NodeTypes.ATTRIBUTE && prop.name === 'ref' && prop.value?.content) {
if (
prop.type === NodeTypes.ATTRIBUTE &&
prop.name === 'ref' &&
prop.value?.content
) {
code += `,${prop.value.content}`
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/dts-test/setupHelpers.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ describe('defineProps w/ union type declaration + withDefaults', () => {
)
})

describe('defineProps w/ generic type declaration + withDefaults', <T extends number, TA extends {
describe('defineProps w/ generic type declaration + withDefaults', <T extends
number, TA extends {
a: string
}, TString extends string>() => {
const res = withDefaults(
Expand All @@ -117,10 +118,10 @@ describe('defineProps w/ generic type declaration + withDefaults', <T extends nu
n: 123,

generic1: () => [123, 33] as T[],
generic2: () => ({ x: 123 } as { x: T }),
generic2: () => ({ x: 123 }) as { x: T },

generic3: () => 'test' as TString,
generic4: () => ({ a: 'test' } as TA)
generic4: () => ({ a: 'test' }) as TA
}
)

Expand Down
5 changes: 4 additions & 1 deletion packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ class RefImpl<T> {
public dep?: Dep = undefined
public readonly __v_isRef = true

constructor(value: T, public readonly __v_isShallow: boolean) {
constructor(
value: T,
public readonly __v_isShallow: boolean
) {
this._rawValue = __v_isShallow ? value : toRaw(value)
this._value = __v_isShallow ? value : toReactive(value)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/__tests__/apiOptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ describe('api: options', () => {
render() {
return this[injectedKey]
}
} as any)
}) as any

const ChildA = defineChild(['a'], 'a')
const ChildB = defineChild({ b: 'a' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('api: template refs', () => {
const toggle = ref(true)

const Comp = defineComponent(
() => () => toggle.value ? h('div', { ref: fn }) : null
() => () => (toggle.value ? h('div', { ref: fn }) : null)
)
render(h(Comp), root)
expect(fn.mock.calls[0][0]).toBe(root.children[0])
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/components/Teleport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function hydrateTeleport(
// Force-casted public typing for h and TSX props inference
export const Teleport = TeleportImpl as unknown as {
__isTeleport: true
new(): {
new (): {
$props: VNodeProps & TeleportProps
$slots: {
default(): VNode[]
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.

0 comments on commit 623ba51

Please sign in to comment.