]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: format code
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 11 Aug 2023 09:30:04 +0000 (17:30 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 11 Aug 2023 09:30:04 +0000 (17:30 +0800)
package.json
packages/compiler-sfc/src/script/importUsageCheck.ts
packages/dts-test/setupHelpers.test-d.ts
packages/reactivity/src/ref.ts
packages/runtime-core/__tests__/apiOptions.spec.ts
packages/runtime-core/__tests__/rendererTemplateRef.spec.ts
packages/runtime-core/src/components/Teleport.ts
pnpm-lock.yaml

index f14db16ddaeebf17f52c45d9f3535407851e340a..d514ccd9190b514e66e069b1d1abd8fcd274158b 100644 (file)
@@ -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",
@@ -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",
index 7019dcf2312e839b626789ddac1106d59d7e79c0..f3c3932d829e9ace77021e6067b6b8d26490bfd7 100644 (file)
@@ -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}`
             }
           }
index 934e6056d2d2539b564cf0a48b89dca9cdb38d15..feb4085dea064aa0ab6bd1d9b3c58d270e21473d 100644 (file)
@@ -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(
@@ -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
     }
   )
 
index ef111fc1ff7aacaac411bca766e4c6480a89c761..915f5760878ebf0c6fef53d2f59ad79d71ad5850 100644 (file)
@@ -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)
   }
index a172196d3f771af554386712caf198550197b4c8..ca712e0d3ac9425e1c5c493bc9f1e6bd6d75b3ff 100644 (file)
@@ -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' })
index 7d6279c52571a3879ca6ac8751411656e2d30eb5..28d7a95eb0b5ce5cbf9cbca215f285382c7ca2c2 100644 (file)
@@ -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])
index 4f7d16bc7d1774addad391c6371d9fd7c285450a..19ccbc5de27a85aee019b722437fee77518aa892 100644 (file)
@@ -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[]
index a4a711ef39be62ee4f6161862018f67d09d33787..378cc5749d4cea23eff93f6383274446124cd64c 100644 (file)
@@ -96,8 +96,8 @@ importers:
         specifier: ^4.1.5
         version: 4.1.5
       prettier:
-        specifier: ^2.7.1
-        version: 2.8.8
+        specifier: ^3.0.1
+        version: 3.0.1
       pug:
         specifier: ^3.0.1
         version: 3.0.2
@@ -4621,9 +4621,9 @@ packages:
     engines: {node: '>= 0.8.0'}
     dev: true
 
-  /prettier@2.8.8:
-    resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
-    engines: {node: '>=10.13.0'}
+  /prettier@3.0.1:
+    resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==}
+    engines: {node: '>=14'}
     hasBin: true
     dev: true